public static void SetMorale(this Agent agent, float morale) { MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>(); if (component == null) { return; } component.Morale = morale; }
public static void ChangeMorale(this Agent agent, float delta) { MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>(); if (component == null) { return; } component.Morale += delta; }
public static bool IsRetreating(this Agent agent, bool isComponentAssured = true) { MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>(); return(component != null && component.IsRetreating); }
public static float GetMorale(this Agent agent) { MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>(); return(component != null ? component.Morale : -1f); }