/// <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>(); } }
/// <summary> /// Fires whenever the state is entered into, after the previous state exits. /// </summary> public override void OnStateEnter() { Carriable carriable = player.CarriedItem; carriable.OnPickup(); }