// Use this for initialization void Awake() { throwablesLeft = new List <ThrowableObject>(throwables); throwAnimation = this.transform.Find("Throw Animation").GetComponent <Animation2D>(); openDoorAnimation = this.transform.Find("OpenDoorAnimation").GetComponent <Animation2D>(); killTrigger = this.transform.Find("killTrigger"); throwAnimation.AddEventListener(this.gameObject); throwPoint = this.transform.Find("ThrowPoint"); }
void Start() { fallEnemy = this.transform.Find("FallEnemy").GetComponent <FallEnemy>(); if (this.transform.Find("FlickHand")) { flickHand = this.transform.Find("FlickHand").GetComponent <Animation2D>(); flickHand.AddEventListener(this.gameObject); flickHand.Hide(); } }
private void StopSliding() { CancelInvoke("StopSliding"); if (currentState == PlayerState.SLIDING) { boxsmall.enabled = false; boxbig.enabled = true; feet.enabled = true; Animation2D slideAnimation = animationController.PlayAnimation("Slide Animation", true, true); slideAnimation.AddEventListener(this.gameObject); this.tearsContainer.position = standEyesPosition.position; } }
public void Show() { animationToPlay.AddEventListener(this.gameObject); animationToPlay.Play(true); if (extraAnimationToPlay) { extraAnimationToPlay.Play(true); } if (spraySound) { SoundUtils.SetSoundVolumeToSavedValue(SoundType.FX); spraySound.Play(); } }
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(); } }
public void Hide() { if (npcPictureNames) { npcPictureNames.gameObject.SetActive(false); } if (this.onHideAnimation) { onShowAnimation.Hide(); onShowAnimation.Stop(); onHideAnimation.AddEventListener(this.gameObject); onHideAnimation.Show(); onHideAnimation.Play(true); } else { this.gameObject.SetActive(false); } }
// Use this for initialization void Awake() { animation2D.AddEventListener(this.gameObject); }