public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Instance == null) { return; } GTEditorHelper.BeginContents(); if (GUILayout.Button("Get All Renderer In Children")) { Renderer[] renderers = Instance.GetComponentsInChildren <Renderer>(true); Instance.Renderers = new List <Renderer>(renderers); } GTEditorHelper.EndContents(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Instance == null) { return; } if (Instance.Panel == null) { EditorGUILayout.HelpBox("Please assign an UIPanel component!", MessageType.Error); } if (Instance.Camera == null) { EditorGUILayout.HelpBox("We will use WindowManager.UICamera when Application is playing", MessageType.Warning); } GTEditorHelper.BeginContents(); if (GUILayout.Button("Get All Renderer In Children")) { Renderer[] renderers = Instance.GetComponentsInChildren <Renderer>(true); Instance.Renderers = new List <Renderer>(renderers); } GTEditorHelper.EndContents(); }