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); }
public override bool Perform() { if (m_TargetAnimal != null && m_TargetAnimal.IsDying()) { return(true); } if (m_TargetAnimal != null) { m_Animator.PlaySlash(); m_TargetAnimal.Kill(0.5f); Invoke("StopSlashing", 0.5f); return(true); } return(false); }
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); }