Esempio n. 1
0
 private UNResourceObject GetFromObjects(string resName, ResourceType resType, ResourceCleanType resCleanType = ResourceCleanType.Count)
 {
     for (int i = 0; i < m_objs.Count; ++i)
     {
         var key = m_objs.GetKey(i);
         if (key.m_type != resType || key.m_name != resName)
         {
             continue;
         }
         var value = m_objs[key];
         for (int j = 0; j < value.Count; ++i)
         {
             var obj = value[j];
             if (obj.m_state == UNObjectStateType.Alive)
             {
                 continue;
             }
             obj.Init();
             return(obj);
         }
     }
     return(null);
 }
Esempio n. 2
0
 public new void Update()
 {
     for (int i = 0; i < m_triggers.Count; ++i)
     {
         var type = m_triggers.GetKey(i);
         if (!m_listeners.ContainsKey(type))
         {
             continue;
         }
         var pars = m_triggers.GetValue(i);
         for (int k = 0; k < pars.Count; ++k)
         {
             DispatchEventImmediate(type, pars[k]);
         }
     }
     m_triggers.Clear();
 }
Esempio n. 3
0
 // update 新 行为
 private void UpdateNewBehavior()
 {
     if (m_curBehavior.IsNull())
     {
         return;
     }
     for (int i = 0; i < m_behaviorsTransRules.Count; ++i)
     {
         var k = m_behaviorsTransRules.GetKey(i);
         var v = m_behaviorsTransRules.GetValue(i);
         for (int j = 0; j < v.Count; ++j)
         {
             if (m_curBehavior.m_type != v[j])
             {
                 continue;
             }
             AddWaitBehavior(k);
             return;
         }
     }
 }