示例#1
0
    public override bool Perform()
    {
        if (m_StartTime == 0)
        {
            m_StartTime = Time.time;
            m_Animator.PlaySlash();
        }


        if (Time.time - m_StartTime > workDurationSecs)
        {
            m_Animator.StopSlash();

            m_Inventory.IncrementResourceCount(ResourceType.Wood, 4);

            m_Inventory.equippedTool.Damage();

            if (m_Inventory.equippedTool.IsDestroyed())
            {
                m_Inventory.equippedTool = null;
            }

            m_TreeChopped = true;
        }

        return(true);
    }
示例#2
0
    public override bool Perform()
    {
        if (m_StartTime == 0)
        {
            m_StartTime = Time.time;
            m_Animator.PlaySlash();
        }


        if (Time.time - m_StartTime > forgeDurationSecs)
        {
            m_Animator.StopSlash();

            m_Inventory.SetResourceCount(ResourceType.Wood, 0);

            m_ToolDispenser.IncrementToolCount(ToolType.WoodenAxe, 1);

            m_Forged = true;
        }

        return(true);
    }
示例#3
0
    private void StopSlashing()
    {
        m_Animator.StopSlash();

        m_Killed = true;
    }