Exemplo n.º 1
0
 /// <summary>
 /// Fires when code outside the state machine is trying to send information.
 /// </summary>
 /// <param name="signal">The signal sent.</param>
 public override void OnSignal(GameObject obj)
 {
     if (CanCarry(obj))
     {
         Carriable item = obj.GetComponent <Carriable>();
         item.OnPickup();
         ChangeToState <CarryJumpFall>();
     }
     else if (IsAimableFlingFlower(obj))
     {
         ChangeToState <FlingFlowerAim>();
     }
     else if (IsDirectionalFlingFlower(obj))
     {
         ChangeToState <FlingFlowerDirectedLaunch>();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///  Fires whenever the state is entered into, after the previous state exits.
        /// </summary>
        public override void OnStateEnter()
        {
            Carriable carriable = player.CarriedItem;

            carriable.OnPickup();
        }