Exemplo n.º 1
0
 protected void Update()
 {
     //将等待增加的动作列表的动作添加到动作列表中
     foreach (SSAction ac in waitingAdd)
     {
         actions[ac.GetInstanceID()] = ac;
     }
     waitingAdd.Clear();
     //向待删除列表添加待删除的动作序号
     foreach (KeyValuePair <int, SSAction> kv in actions)
     {
         SSAction ac = kv.Value;
         if (ac.destroy)
         {
             waitingDelete.Add(ac.GetInstanceID());
         }
         else if (ac.enable)
         {
             ac.Update();
         }
     }
     //删除待删除的动作
     foreach (int key in waitingDelete)
     {
         SSAction ac = actions[key];
         actions.Remove(key);
         DestroyObject(ac);
     }
     waitingDelete.Clear();
 }
Exemplo n.º 2
0
        public void FreeSSAction(SSAction action)
        {
            SSAction tmp = null;

            foreach (SSAction i in used)
            {
                if (action.GetInstanceID() == i.GetInstanceID())
                {
                    tmp = i;
                }
            }
            if (tmp != null)
            {
                tmp.reset();
                free.Add(tmp);
                used.Remove(tmp);
            }
        }