예제 #1
0
 protected void SetStateHandler(int state, AiStateHandler handler)
 {
     if (state > (int)AiStateId.Invalid && state < (int)AiStateId.MaxNum)
     {
         if (null != handler)
         {
             if (m_Handlers.ContainsKey(state))
             {
                 m_Handlers[state] = handler;
             }
             else
             {
                 m_Handlers.Add(state, handler);
             }
         }
         else
         {
             m_Handlers.Remove(state);
         }
     }
 }
예제 #2
0
 protected void SetStateHandler(int state, AiStateHandler handler)
 {
     if (state > (int)AiStateId.Invalid && state < (int)AiStateId.MaxNum) {
         if (null != handler) {
             if (m_Handlers.ContainsKey(state))
                 m_Handlers[state] = handler;
             else
                 m_Handlers.Add(state, handler);
         } else {
             m_Handlers.Remove(state);
         }
     }
 }