public void RemoveSceneObjectController(string id, SceneObjectController SceneObjectController) { List <SceneObjectController> SceneObjectControllers_; if (SceneObjectControllerDic.TryGetValue(id, out SceneObjectControllers_)) { SceneObjectControllers_.Remove(SceneObjectController); if (SceneObjectControllers_.Count <= 0) { SceneObjectControllerDic.Remove(id); } } #if UNITY_EDITOR SceneObjectControllers.Remove(SceneObjectController); #endif }
public void AddSceneObjectController(string id, SceneObjectController SceneObjectController) { List <SceneObjectController> SceneObjectControllers_; if (SceneObjectControllerDic.TryGetValue(id, out SceneObjectControllers_)) { SceneObjectControllers_.Add(SceneObjectController); } else { SceneObjectControllerDic.Add(id, new List <SceneObjectController>() { SceneObjectController }); } #if UNITY_EDITOR SceneObjectControllers.Add(SceneObjectController); #endif }