protected virtual void OnActivated(int playerIndex) { foreach (TextBox textBox in textBoxes) { textBox.gameObject.SetActive(false); SoundUtils.SetSoundVolumeToSavedValueForGameObject(SoundType.FX, this.gameObject); } Transform onShowAnimationsTransform = this.transform.Find("Animations/OnShowAnimation"); Transform onHideAnimationsTransform = this.transform.Find("Animations/OnHideAnimation"); if (onShowAnimationsTransform && onHideAnimationsTransform) { onShowAnimation = this.transform.Find("Animations/OnShowAnimation").GetComponent <Animation2D>(); onHideAnimation = this.transform.Find("Animations/OnHideAnimation").GetComponent <Animation2D>(); onShowAnimation.AddEventListener(this.gameObject); onHideAnimation.AddEventListener(this.gameObject); onHideAnimation.Stop(); onHideAnimation.Hide(); onShowAnimation.Show(); onShowAnimation.Awake(); onShowAnimation.Play(true); isBusy = true; } else { ShowNextTextBalloon(); } if (onShowSound) { SoundUtils.SetSoundVolumeToSavedValueForGameObject(SoundType.FX, this.gameObject); onShowSound.Play(); } isActivated = true; }
public void OnActivated() { foreach (TextBox textBox in textBoxes) { textBox.active = false; SoundUtils.SetSoundVolumeToSavedValue(SoundType.FX); } Transform onShowAnimationsTransform = this.transform.Find("Animations/OnShowAnimation"); Transform onHideAnimationsTransform = this.transform.Find("Animations/OnHideAnimation"); if (onShowAnimationsTransform && onHideAnimationsTransform) { onShowAnimation = this.transform.Find("Animations/OnShowAnimation").GetComponent <Animation2D>(); onHideAnimation = this.transform.Find("Animations/OnHideAnimation").GetComponent <Animation2D>(); onShowAnimation.AddEventListener(this.gameObject); onHideAnimation.AddEventListener(this.gameObject); onHideAnimation.Stop(); onHideAnimation.Hide(); onShowAnimation.Show(); onShowAnimation.Awake(); onShowAnimation.Play(true); isBusy = true; } else { ShowNextTextBalloon(); } if (onShowSound) { SoundUtils.SetSoundVolumeToSavedValue(SoundType.FX); onShowSound.Play(); } }