/// <summary> /// 添加FixedUpdate /// </summary> /// <param name="handle"></param> private int AddFixedUpdate(UpdateHandle handle) { int id = GetHandleId(); FixedUpdateHandle.Add(handle); IndexDict.Add(id, handle); return(id); }
/// <summary> /// 删除处理 /// </summary> /// <param name="handle"></param> private void RemoveHandleFormList(UpdateHandle handle) { int ind = HandleList.IndexOf(handle); if (ind >= 0) { HandleList.RemoveAt(ind); } else { ind = ForceHandleList.IndexOf(handle); if (ind >= 0) { ForceHandleList.RemoveAt(ind); } } ind = FixedUpdateHandle.IndexOf(handle); if (ind > 0) { ForceHandleList.RemoveAt(ind); } //else //{ // GameLogger.LogError("找不到已经注册的handle删除"); //} if (IndexDict.ContainsValue(handle)) { int id = -1; foreach (KeyValuePair <int, UpdateHandle> item in IndexDict) { if (item.Value == handle) { id = item.Key; break; } } if (id >= 0) { IndexDict.Remove(id); } } }