Exemple #1
0
    public override void SetTarget()
    {
        // Stops thrusting animation (used when
        // another NPC kills the target enemy and Perform is not called).
        m_Animator.StopThrust();

        var closest = GetClosest();

        if (closest != null)
        {
            m_TargetEnemy = closest;
            target        = m_TargetEnemy.transform;
        }
    }
Exemple #2
0
    public override bool Perform()
    {
        if (m_StartTime == 0)
        {
            m_StartTime = Time.time;
            m_Animator.PlayThrust();
        }


        if (Time.time - m_StartTime > cookDurationSecs)
        {
            m_Animator.StopThrust();

            m_Inventory.IncrementResourceCount(ResourceType.Meat, -1);

            m_Inventory.IncrementResourceCount(ResourceType.CookedMeat, 1);

            m_Cooked = true;
        }

        return(true);
    }