Пример #1
0
 private void OnTriggerEnter(Collider collider)
 {
     if (SlideController != null && SlideController.gameObject != null)
     {
         PenguinInteraction component = SlideController.gameObject.GetComponent <PenguinInteraction>();
         if (component != null)
         {
             component.OnTriggerEnter(collider);
         }
     }
 }
        protected void DefaultDoAction(LocomotionAction action, object userData = null)
        {
            switch (action)
            {
            case LocomotionAction.ChargeThrow:
                if (snowballThrow != null)
                {
                    snowballThrow.ChargeSnowball();
                }
                break;

            case LocomotionAction.LaunchThrow:
                if (snowballThrow != null)
                {
                    snowballThrow.LaunchSnowball((float)userData);
                }
                break;

            case LocomotionAction.Interact:
            {
                PenguinInteraction component = GetComponent <PenguinInteraction>();
                if (component != null && component.RequestInteraction())
                {
                    Broadcaster.BroadcastOnDoAction(action, userData);
                }
                break;
            }

            case LocomotionAction.Action1:
            case LocomotionAction.Action2:
            case LocomotionAction.Action3:
            {
                PenguinInteraction component = GetComponent <PenguinInteraction>();
                if (component != null && !LocomotionUtils.IsInAir(LocomotionUtils.GetAnimatorStateInfo(animator)))
                {
                    Broadcaster.BroadcastOnDoAction(action, userData);
                }
                break;
            }
            }
        }