当前位置: 首页>>代码示例>>C#>>正文


C# AudioManager类代码示例

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


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


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