Esempio n. 1
0
        public static void SetMorale(this Agent agent, float morale)
        {
            MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>();

            if (component == null)
            {
                return;
            }
            component.Morale = morale;
        }
Esempio n. 2
0
        public static void ChangeMorale(this Agent agent, float delta)
        {
            MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>();

            if (component == null)
            {
                return;
            }
            component.Morale += delta;
        }
Esempio n. 3
0
        public static bool IsRetreating(this Agent agent, bool isComponentAssured = true)
        {
            MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>();

            return(component != null && component.IsRetreating);
        }
Esempio n. 4
0
        public static float GetMorale(this Agent agent)
        {
            MoraleAgentComponent component = agent.GetComponent <MoraleAgentComponent>();

            return(component != null ? component.Morale : -1f);
        }