Ejemplo n.º 1
0
    public void UpdateActiveItem()
    {
        if (m_ActiveItem == null)
        {
            return;
        }

        if (m_ActiveItem.ItemType == ItemType.ActiveRoom)
        {
            if ((m_ActiveItem as AbstractActiveRoomBased).RoomCooldown == 0)
            {
                if (CharacterController.GetUseItemDown())
                {
                    m_ActiveItem.UpdateItem();
                }
            }
        }
        else if (m_ActiveItem.ItemType == ItemType.ActiveTimer)
        {
            if ((m_ActiveItem as AbstractActiveTimerBased).IsActivated)
            {
                m_ActiveItem.UpdateItem();
            }
            else if ((m_ActiveItem as AbstractActiveTimerBased).Timer > (m_ActiveItem as AbstractActiveTimerBased).CooldownTime)
            {
                if (CharacterController.GetUseItemDown())
                {
                    m_ActiveItem.UpdateItem();
                }
            }
            else
            {
                (m_ActiveItem as AbstractActiveTimerBased).Timer += Time.deltaTime;
            }
        }
    }