Esempio n. 1
0
        public void StopAllSounds()
        {
            awaitingSlots.Clear();

            for (int i = 0; i < playingSources.Count; i++)
            {
                AudioSource     source = playingSources[i];
                CoroutineRunner runner = source.GetComponent <CoroutineRunner>();
                Assert.IsFalse(runner == null, "Trying to stop sound from invalid source");
                runner.StopAllCoroutines();

                source.Stop();
                AddSingleSource(ref source, ref availableSources);
            }

            playingSources.Clear();
        }
Esempio n. 2
0
        public void SetState(ScriptableState state)
        {
            if (currentState != null)
            {
                currentState.WillLeaveState();
            }

            currentState = state;
            if (currentState != null)
            {
                if (runner == null)
                {
                    runner = CoroutineRunner.Instantiate(this.name);
                    DontDestroyOnLoad(runner);
                }

                currentState.WillEnterState(runner);
            }
        }
Esempio n. 3
0
 public void WillEnterState(CoroutineRunner runner)
 {
     this.runner = runner;
     OnEnterState();
 }