public void RemoveSubView(GTEditorSubView view) { if (view == null) { return; } if (AllSubViews == null || AllSubViews.Count == 0) { return; } view.OnDestroy(); AllSubViews.Remove(view.ViewID); }
public void NotityAllSubView(EditorWindowEvtType evtType, object param) { if (AllSubViews != null && AllSubViews.Count > 0) { Dictionary <int, GTEditorSubView> .Enumerator em = AllSubViews.GetEnumerator(); for (int i = 0; i < AllSubViews.Count; i++) { em.MoveNext(); KeyValuePair <int, GTEditorSubView> kvp = em.Current; GTEditorSubView subView = kvp.Value; if (subView == null) { continue; } switch (evtType) { case EditorWindowEvtType.OnGUI: subView.OnGUI(); break; case EditorWindowEvtType.Update: subView.Update(); break; case EditorWindowEvtType.OnInspectorUpdate: subView.OnInspectorUpdate(); break; case EditorWindowEvtType.OnSelectionChange: subView.OnSelectionChange(); break; case EditorWindowEvtType.OnFocus: subView.OnFoucs(); break; case EditorWindowEvtType.OnLostFocus: subView.OnLostFocus(); break; case EditorWindowEvtType.OnHierarchyChange: subView.OnHierarchyChange(); break; case EditorWindowEvtType.OnProjectChange: subView.OnProjectChange(); break; case EditorWindowEvtType.OnEnable: subView.OnEnable(); break; case EditorWindowEvtType.OnDisable: subView.OnDisable(); break; case EditorWindowEvtType.OnDestroy: subView.OnDestroy(); break; default: break; } } } }