Exemplo n.º 1
0
 public override void Interact(Action action, Clickable target)
 {
     if (action == Action.MAKE_POTION)
     {
         AudioSource audioS = GetComponent <AudioSource>();
         if (!bucketAtCauldron.activeSelf)
         {
             // NO WATER
             NextState   = Gal02State.IDLE;
             audioS.clip = angryTrack;
             audioS.Play();
             return;
         }
         Cauldron c = (Cauldron)target;
         if (!c.IsFull())
         {
             // NOT FULL
             audioS.clip = angryTrack;
             audioS.Play();
             NextState = Gal02State.IDLE;
             return;
         }
         audioS.clip = yesTrack;
         audioS.Play();
         NextState = Gal02State.APROACHING_CAULDRON;
     }
     else if (action == Action.GIVE_POTION && potionIsReady)
     {
         happyKid.SetActive(true);
         dyingKid.SetActive(false);
         GoToNextLevel();
     }
 }
Exemplo n.º 2
0
 public override void Interact(Action action, Clickable target)
 {
     if (action == Action.PICKUP_PLANT)
     {
         Cauldron c = FindObjectOfType <Cauldron>();
         if (!c.IsFull())
         {
             if (target.GetType() == typeof(Plant1))
             {
                 NextState = OldManState02.GOING1;
             }
             else if (target.GetType() == typeof(Plant2))
             {
                 NextState = OldManState02.GOING2;
             }
             else
             {
                 NextState = OldManState02.GOING3;
             }
         }
     }
 }