Esempio n. 1
0
        private void CreateSoundSource()
        {
            CoroutineRunner runner = CoroutineRunner.Instantiate("SoundInstance");

            runner.name = AvailableName;
            availableSources.Add(runner.gameObject.AddComponent <AudioSource>());
        }
Esempio n. 2
0
        public override void OnBoot()
        {
            return;

            Assert.IsTrue(emptyIdentifier != string.Empty, $"emptyIdentifier not assigned to " + this.name);

            foreach (SceneTransitionDefinition transition in transitions)
            {
                Assert.IsNotNull(transition, $"SceneTransitionDefinition not assigned to " + this.name);
            }

            this.runner = CoroutineRunner.Instantiate(this.name);
            this.transitionableScenes = new HashSet <string>();
            this.transitionsByKey     = new Dictionary <string, SceneTransitionDefinition>();

            foreach (SceneTransitionDefinition transition in this.transitions)
            {
                this.transitionableScenes.Add(transition.PrevScene);
                this.transitionableScenes.Add(transition.NextScene);
                this.transitionsByKey[transition.TransitionKey] = transition;
            }

            SceneManager.sceneLoaded += this.OnSceneLoaded;

            this.EmptyTransition();
        }
Esempio n. 3
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);
            }
        }