public bool IsPushing()
    {
        if (m_MovementModel.IsMoving() == false || m_WasMoving == false)
        {
            return(false);
        }

        if (m_ClosestPushable != null)
        {
            return(true);
        }

        if (m_MovementModel.IsFrozen() == true)
        {
            return(false);
        }

        if (GameCamera.Instance.IsSwitchingScene() == true)
        {
            return(false);
        }

        return(GetMovingDuration() > 0.1f &&
               GetTimeInSamePosition() > 0.1f);
    }
Exemple #2
0
    void UpdatePickUpAnimation()
    {
        bool pickUpOneHand  = false;
        bool pickUpTwoHands = false;

        if (movementModel.IsFrozen() == true)
        {
            ItemType pickupItem = movementModel.GetItemThatIsBeingPickUp();

            if (pickupItem != ItemType.None)
            {
                ItemData itemData = Database.Item.FindItem(pickupItem);

                switch (itemData.getPickUpAnimation(movementModel.GetPickUpType()))
                {
                case ItemData.PickUpAnim.OneHand:
                    pickUpOneHand = true;
                    break;

                case ItemData.PickUpAnim.TwoHands:
                    pickUpTwoHands = true;
                    break;
                }
            }
        }

        animator.SetBool("PickUpOneHand", pickUpOneHand);
        animator.SetBool("PickUpTwoHands", pickUpTwoHands);
    }
    void UpdatePickingUpAnimation()
    {
        bool isPickingUpOneHanded = false;
        bool isPickingUpTwoHanded = false;

        if (m_MovementModel.IsFrozen())
        {
            ItemType pickupItem = m_MovementModel.GetItemThatIsBeingPickedUp();

            if (m_MovementModel.GetItemThatIsBeingPickedUp() != ItemType.None)
            {
                ItemData itemData = DataBase.Item.FindItem(pickupItem);
                switch (itemData.pickUpAnimation)
                {
                case ItemData.PickUpAnimation.OneHanded:
                    isPickingUpOneHanded = true;
                    break;

                case ItemData.PickUpAnimation.TwoHanded:
                    isPickingUpTwoHanded = true;
                    break;
                }
            }
            else
            {
                isPickingUpOneHanded = false;
                isPickingUpTwoHanded = false;
            }
        }

        Animator.SetBool("IsPickingUpOneHanded", isPickingUpOneHanded);
        Animator.SetBool("IsPickingUpTwoHanded", isPickingUpTwoHanded);
    }
Exemple #4
0
 //Are we pushing something currently?
 public bool IsPushing()
 {
     if (m_MovementModel.IsMoving() == false || m_WasMoving == false)
     {
         return(false);                                                             //If we are not moving or were moving, then nah
     }
     if (m_ClosestPushable != null)
     {
         return(true);                           //If there is a close pushable set, then ye
     }
     if (m_MovementModel.IsFrozen() == true)
     {
         return(false);                                    //if we are frozen, then nah
     }
     if (GameCamera.Instance.IsSwitchingScene() == true)
     {
         return(false);                                                //if we are currently switching scenes, nah
     }
     return(GetMovingDuration() > 0.1f &&
            GetTimeInSamePosition() > 0.1f); //if the moving duration is less than this value AND we are in the same position for this value
 }
    public bool IsPushing()
    {
        if (characterMovement.IsMoving() == false || m_WasMoving == false)
        {
            return(false);
        }

        if (closestPushable != null)
        {
            return(true);
        }

        if (characterMovement.IsFrozen() == true)
        {
            return(false);
        }


        return(GetMovingDuration() > 0.1f &&
               GetTimeInSamePosition() > 0.1f);
    }
Exemple #6
0
    void UpdatePickupAnimation()
    {
        bool isPickingUpOneHand = false;
        bool isPickingUpTwoHand = false;

        if (_movementModel.IsFrozen())
        {
            var pickedUpItemType = _movementModel.GetPickedUpItem();
            if (pickedUpItemType != ItemType.None)
            {
                var pickedUpItemData = Database.Items.FindItem(pickedUpItemType);
                if (pickedUpItemData.Animation == PickUpAnimation.OneHand)
                {
                    isPickingUpOneHand = true;
                }
                if (pickedUpItemData.Animation == PickUpAnimation.TwoHand)
                {
                    isPickingUpTwoHand = true;
                }
            }
        }
        Animator.SetBool("IsPickingUpOneHand", isPickingUpOneHand);
        Animator.SetBool("IsPickingUpTwoHand", isPickingUpTwoHand);
    }