Ejemplo n.º 1
0
        /// <summary>
        /// Устанавливает состояение по умолчанию как текущее.
        /// </summary>
        public void SetDefaultState()
        {
            if (currentState != null)
            {
                currentState.Stop();
            }

            AntLog.Assert(defaultState == null, "Default <b>State</b> is not defined!", true);
            currentState = defaultState;
            currentState.Reset();
            currentState.Start();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Устанавливает состояение по умолчанию как текущее.
        /// </summary>
        public void SetDefaultState()
        {
            if (currentState != null)
            {
                currentState.Stop();
            }

            if (defaultState != null)
            {
                currentState = defaultState;
                currentState.Reset();
                currentState.Start();
            }
            else
            {
                AntLog.Report("AIControl", "Default State not defined!");
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Устанавливает указанное состояние как текущее.
 /// </summary>
 public void SetState(string aStateName, bool aForce = false)
 {
     if (aForce || !string.Equals(currentState.name, aStateName))
     {
         currentState.Stop();
         currentState = FindState(aStateName);
         if (currentState != null)
         {
             currentState.Reset();
             currentState.Start();
         }
         else
         {
             AntLog.Report("AntAIAgent", "Can't find \"{0}\" state.", aStateName);
             SetDefaultState();
         }
     }
 }