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);
    }
Esempio n. 2
0
 public void OnIrrigate(Irrigate irrigated, GameObject irrigating, int dropsConsumed)
 {
     // Plays the irrigation sound
     if (irrigating == gameObject)
         irrigate.PlayAudio();
 }
Esempio n. 3
0
 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());
 }
Esempio n. 4
0
 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);
 }