public void DrawView(GTEditorSubView context) { if (Components == null || Components.Count == 0) { return; } if (Width <= 0) { return; } if (Height <= 0) { GUILayout.BeginHorizontal("box", GUILayout.Width(Width)); } else { GUILayout.BeginHorizontal("box", GUILayout.Width(Width), GUILayout.Height(Height)); } for (int i = 0; i < Components.Count; i++) { GTEditorToolbarViewComponent com = Components[i]; if (com == null) { continue; } com.Draw(this); } GUILayout.EndHorizontal(); }
public GTEditorToolbarViewComponent GetComponentByNumber <T>(int number) { if (Components == null || Components.Count == 0) { return(null); } for (int i = 0; i < Components.Count; i++) { GTEditorToolbarViewComponent com = Components[i]; if (com == null) { return(null); } if (com.GetType() == typeof(T) && com.Number == number) { return(com); } } return(null); }