void Start() { // Retrieves the desired components // This needs to be done on the start method since this object // is going to be instantiated _irrigate = GetComponentInParent<Irrigate>(); _independentControl = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent<GameControllerIndependentControl>(); // Registers itself to the Irrigate events _irrigate.AddListener(this); }
public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed) { // Plays the irrigation sound if (irrigating == gameObject) irrigate.PlayAudio(); }
public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed) { // Plays the irrigation effect Transform characterTransform = irrigating.transform; irrigate.PlayEffect(characterTransform.position, characterTransform.rotation, _characterSize.GetSize()); }
public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed) { // Notifies any irrigation listener on the object's children foreach (IrrigateListener listener in GetComponentsInChildren<IrrigateListener>()) if (listener != this) listener.OnIrrigate(irrigated, irrigating, dropsConsumed); }
public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed) { // Disables the help item enabled = false; Hide(); }
public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed) { // Sets the irrigate trigger on the animator _animator.SetTrigger(CharacterAnimatorParameters.Irrigate); }