public override bool Perform() { // Someone else killed the enemy if (m_TargetEnemy == null || m_TargetEnemy.IsDead) { m_Killed = true; m_Animator.StopThrust(); return(true); } if (m_StartTime == 0f) { m_Animator.PlayThrust(); m_StartTime = Time.time; } if (Time.time - m_StartTime > hitTime) { m_TargetEnemy.DoDamage(); if (m_TargetEnemy == null || m_TargetEnemy.IsDead) { m_Animator.StopThrust(); m_Killed = true; } m_StartTime = 0f; } return(true); }
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); }