• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AudioManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AudioManager的典型用法代码示例。如果您正苦于以下问题:C# AudioManager类的具体用法?C# AudioManager怎么用?C# AudioManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AudioManager类属于命名空间,在下文中一共展示了AudioManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FindScripts

    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller =  Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent<CameraController>();
        sc_GameController   = controller.GetComponent<GameController>();
        sc_LevelManager     = controller.GetComponent<LevelManager>();
        sc_RowManager       = controller.GetComponent<RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager     = GameObject.Find("audio_manager").GetComponent<AudioManager>();

        if (LevelName == "Intro") return;

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent<FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent<HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
            sc_ScoreTracker     = GameObject.Find("score_tracker").GetComponent<ScoreTracker>();

        if (CheckObjectExist("glow_ball"))
            sc_BallController   = GameObject.Find("glow_ball").GetComponent<BallController>();

        if (CheckObjectExist("boundaries"))
            sc_BoundaryManager   = GameObject.Find("boundaries").GetComponent<BoundaryManager>();
    }
开发者ID:Kurukshetran,项目名称:Glowball,代码行数:28,代码来源:ScriptHelper.cs


示例2: Start

	// Use this for initialization
	void Start ()
	{
		if (am == null) {
			am = GameObject.FindGameObjectWithTag ("AudioManager").GetComponent<AudioManager> ();
			Debug.Log ("Found AudioManager");
		}
	}
开发者ID:stagdage,项目名称:GameJam2016,代码行数:8,代码来源:SliderFindAudioManager.cs


示例3: GameStateManager

        public GameStateManager(GraphicsDeviceManager man,ContentManager cman,MineWorldClient gam)
        {
            Audiomanager = new AudioManager();
            Config = new ConfigFile("data/settings.ini");
            _inputhelper = new InputHelper();
            Game = gam;
            Conmanager = cman;
            Graphics = man;
            Device = Graphics.GraphicsDevice;
            SpriteBatch = new SpriteBatch(Device);
            _screens = new BaseState[]
                           {
                               new TitleState(this, GameState.TitleState),
                               new MainMenuState(this, GameState.MainMenuState),
                               new LoadingState(this, GameState.LoadingState),
                               new MainGameState(this, GameState.MainGameState),
                               new SettingsState(this, GameState.SettingsState),
                               _serverbrowsingstate = new ServerBrowsingState(this, GameState.ServerBrowsingState),
                               _errorstate = new ErrorState(this, GameState.ErrorState)
                           };
            //curScreen = titlestate;
            Pbag = new PropertyBag(gam,this);

            //Set initial state in the manager itself
            SwitchState(GameState.TitleState);
        }
开发者ID:dkfdevil,项目名称:Mine-World,代码行数:26,代码来源:GameStateManager.cs


示例4: GetInstance

 public static AudioManager GetInstance()
 {
     if (instance == null) {
         instance = new AudioManager();
     }
     return instance;
 }
开发者ID:Bosphoros,项目名称:Unity-TowerDefense,代码行数:7,代码来源:AudioManager.cs


示例5: Awake

 void Awake()
 {
     sfx = AudioManager.instance;
     navigator = Navigator.instance;
     sfx.Play("Audio/Bgm/Scenes/GameOver", 0, 1f, true);
     sfx.Fade("Audio/Bgm/Scenes/GameOver", 0.25f, 0.5f);
 }
开发者ID:snaptothegrid,项目名称:Tiler,代码行数:7,代码来源:GameOver.cs


示例6: Start

    // Use this for initialization
    void Start()
    {
        manager = gameObject.GetComponent<AudioManager>();
        gameManager = GameObject.Find("TrainManager").GetComponent<TrainManager>();
        hand = gameObject.GetComponentInChildren<TutorialHand>();
        tutorialCow = GameObject.Find("TutorialCow");

        tutorialCow.SetActive(false);

        if(GameObject.Find("SelectedTrain") != null)
        {
            SelectedTrain selectedTrain = GameObject.Find("SelectedTrain").GetComponent<SelectedTrain>();

            if (selectedTrain.showTutorial)
            {
                //Debug.Log("SHOWING TUTORIAL");
                StartCoroutine("runTutorial");
            }
            else
            {
                //Debug.Log("NOT SHOWING TUTORIAL");
                gameManager.startTrain();
                Destroy(this.gameObject);
            }
        }
        else
        {
            //Debug.Log("NOT SHOWING TUTORIAL - selected train not found");
            gameManager.startTrain();
            Destroy(this.gameObject);
        }
    }
开发者ID:dany1532,项目名称:Social_Clues,代码行数:33,代码来源:TrainSetTutorial.cs


示例7: Awake

	protected void Awake()
	{
		currency = Dependency.Get<Currency>();
		audioManager = Dependency.Get<AudioManager>();

		storeUI.enabled = false;
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:7,代码来源:Store.cs


示例8: Start

 void Start()
 {
     audioManager = AudioManager.Instance;
     if (autoPlayMusic) {
         audioManager.PlayMenuMusic();
     }
 }
开发者ID:thanniaB,项目名称:censor-me,代码行数:7,代码来源:MainMenu.cs


示例9: Start

    // Use this for initialization
    void Start()
    {
        if(am == null) am = GameObject.Find("AudioManager").GetComponent<AudioManager>();
        if(lc == null) lc = GameObject.Find("LevelController").GetComponent<LevelController>();

        StartCoroutine(ResetStage());
    }
开发者ID:MangoSister,项目名称:Doot-Doot-Cat,代码行数:8,代码来源:MainGameManager.cs


示例10: Start

    void Start()
    {
        navigator = Navigator.instance;
        sfx = AudioManager.instance;

        sfx.Play("Audio/Bgm/Music/Alone", 0.5f, 1f, true);
    }
开发者ID:snaptothegrid,项目名称:Tilebase,代码行数:7,代码来源:Home.cs


示例11: Awake

	void Awake ()
	{
		audioManager = GameObject.Find ("AudioManager").GetComponent <AudioManager>();

		screenCrash = GameObject.Find ("ScreenCrash").transform;
		mainCamera = GameObject.Find ("Main Camera").transform;
	}
开发者ID:CountrysideGames,项目名称:Nostalgia,代码行数:7,代码来源:BrickCollision.cs


示例12: Start

 void Start()
 {
     am = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioManager>();
     transform.Translate (-Vector3.up * 2);
     startPos = transform.position;
     playerTrans = GameObject.FindGameObjectWithTag("Player").transform;
 }
开发者ID:C453,项目名称:SOLAR,代码行数:7,代码来源:EnemyBulletController.cs


示例13: TagApplies

        public override bool TagApplies(UnityEngine.GameObject gameObject, AudioManager.ListenerInfo info)
        {
            SettingsManager.Options ModOptions = gameObject.GetComponent<SettingsManager>().ModOptions;
            int finalHappiness = (int)Singleton<DistrictManager>.instance.m_districts.m_buffer[0].m_finalHappiness;

            return (finalHappiness < ModOptions.MoodDependentMusic_MoodThreshold);
        }
开发者ID:AmonRGT,项目名称:CSLMusicMod,代码行数:7,代码来源:TagVanillaMood.cs


示例14: PlayClip

    public static AudioSource PlayClip(AudioClip clip, float volume = 1, float pitch = 1)
    {
        if (clip == null)
            return null;
        if (_instance == null)
            _instance = FindObjectOfType<AudioManager>();

        AudioSource audioSource = null;
        foreach (var source in _instance._soundClipPool)
        {
            if (!source.isPlaying)
            {
                audioSource = source;
                break;
            }
        }
        if (audioSource == null)
        {
            audioSource = _instance.gameObject.AddComponent<AudioSource>();
            _instance._soundClipPool.Add(audioSource);
        }

        audioSource.clip = clip;
        audioSource.volume = volume;
        audioSource.pitch = pitch;
        audioSource.loop = false;
        audioSource.enabled = true;

        audioSource.Play();

        return audioSource;
    }
开发者ID:CptDefault,项目名称:ggj2016,代码行数:32,代码来源:AudioManager.cs


示例15: SoundEffect

        /// <summary>
        /// Initializes a new instance of the <see cref="SoundEffect"/> class.
        /// </summary>
        /// <param name="audioManager">The associated audio manager instance.</param>
        /// <param name="name">The name of the current instance.</param>
        /// <param name="waveFormat">The format of the current instance.</param>
        /// <param name="buffer">The buffer containing audio data.</param>
        /// <param name="decodedPacketsInfo">The information regaring decoded packets.</param>
        internal SoundEffect(AudioManager audioManager, string name, WaveFormat waveFormat, DataStream buffer, uint[] decodedPacketsInfo)
        {
            AudioManager = audioManager;
            Name = name;
            Format = waveFormat;
            AudioBuffer = new AudioBuffer
            {
                Stream = buffer,
                AudioBytes = (int)buffer.Length,
                Flags = BufferFlags.EndOfStream,
            };
            LoopedAudioBuffer = new AudioBuffer
            {
                Stream = buffer,
                AudioBytes = (int)buffer.Length,
                Flags = BufferFlags.EndOfStream,
                LoopCount = AudioBuffer.LoopInfinite,
            };

            DecodedPacketsInfo = decodedPacketsInfo;

            Duration = Format.SampleRate > 0 ? TimeSpan.FromMilliseconds(GetSamplesDuration() * 1000 / Format.SampleRate) : TimeSpan.Zero;

            children = new List<WeakReference>();
            VoicePool = AudioManager.InstancePool.GetVoicePool(Format);
        }
开发者ID:EvanMachusak,项目名称:SharpDX,代码行数:34,代码来源:SoundEffect.cs


示例16: Awake

	private void Awake()
	{
		Audio = GetComponent<AudioManager>();
		GameStateIntro.Audio.playThemeIntro();

		DontDestroyOnLoad(this);
	}
开发者ID:Kingpin0509,项目名称:CardioWars,代码行数:7,代码来源:GameStateIntro.cs


示例17: Start

 void Start()
 {
     _gameManager = GameManager.Instance;
     _objectManager = _gameManager.getObjectManager();
     _audioManager = _gameManager.getAudioManager();
     Random.seed = (int)System.DateTime.Now.Ticks;
 }
开发者ID:rubenmv,项目名称:bumpy-ride,代码行数:7,代码来源:PlayerHealth.cs


示例18: Awake

    void Awake()
    {
        var objects = FindObjectsOfType<AudioManager>();
        if (objects.Length > 1) { Destroy(gameObject); }
        else { DontDestroyOnLoad(gameObject); }

        Instance = FindObjectOfType<AudioManager>();
        if (Instance == null) {
          Debug.LogError("null instance");

          var manager = new GameObject();
          var setting = new GameObject().AddComponent<AudioSetting>();
          var audio = new GameObject();
          setting.transform.parent = manager.transform;
          audio.transform.parent = manager.transform;

          Instance = manager.AddComponent<AudioManager>();
        }

        bgm_ = null;
        se_ = new List<AudioSource>();
        bgm_clips_ = new List<AudioClip>();
        se_clips_ = new List<AudioSource>();

        Debug.Log("AudioManager.Awake() fin");
    }
开发者ID:kazukin134,项目名称:MagicTokyo,代码行数:26,代码来源:AudioManager.cs


示例19: Awake

	void Awake ()
	{
		// Setting up the references.
		anim = GetComponent<Animator>();
		proximity = GetComponent<Proximity> ();
		audioManager = GameObject.FindGameObjectWithTag ("Sound").GetComponent<AudioManager> ();
	}
开发者ID:yhchun1992,项目名称:PixelJam2014,代码行数:7,代码来源:SimpleMovement.cs


示例20: Init

    public virtual void Init(Grid grid, int x, int y, float scale = 1, Sprite asset = null)
    {
        sfx = AudioManager.instance;

        container = transform.Find("Sprites");
        outline = transform.Find("Sprites/Outline").GetComponent<SpriteRenderer>();
        img = transform.Find("Sprites/Sprite").GetComponent<SpriteRenderer>();
        shadow = transform.Find("Sprites/Shadow").GetComponent<SpriteRenderer>();
        shadow.gameObject.SetActive(false);

        label = transform.Find("Label").GetComponent<TextMesh>();
        label.GetComponent<Renderer>().sortingLayerName = "Ui";
        label.gameObject.SetActive(Debug.isDebugBuild);

        this.grid = grid;
        this.x = x;
        this.y = y;
        this.asset = asset;

        this.walkable = true;

        transform.localPosition = new Vector3(x, y, 0);

        SetAsset(asset);
        SetImages(scale, Vector3.zero, 0);
        SetSortingOrder(0);

        visible = false;
        explored = false;
    }
开发者ID:snaptothegrid,项目名称:Tiler,代码行数:30,代码来源:Tile.cs



注:本文中的AudioManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AudioTrack类代码示例发布时间:2022-05-24
下一篇:
C# AudioClientShareMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap