private void CreateSoundSource() { CoroutineRunner runner = CoroutineRunner.Instantiate("SoundInstance"); runner.name = AvailableName; availableSources.Add(runner.gameObject.AddComponent <AudioSource>()); }
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(); }
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); } }