private void DrawZone(Zone zone) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("X", EditorToolkit.CloseButtonLayoutOption())) { GameObject.DestroyImmediate(zone.gameObject); return; } if (zone.messageReceiver == null && zone.triggerType == Zone.ZoneTriggerTypes.SendMessage) { EditorGUILayout.LabelField( string.Format("{0} (no receiver)", zone.gameObject.name), EditorToolkit.ErrorLabelStyle() ); } else { zone.gameObject.name = EditorGUILayout.TextField( zone.gameObject.name, EditorToolkit.BoundaryGroupSytle(zone.color) ); } if (GUILayout.Button("Go >", EditorToolkit.GoButtonLayoutOption())) { Selection.activeGameObject = zone.gameObject; } EditorGUILayout.EndHorizontal(); }
private bool DrawPoolHeader(Pool pool) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("X", EditorToolkit.CloseButtonLayoutOption())) { Undo.RegisterSceneUndo("Deleted UDT Pool"); GameObject.DestroyImmediate(pool.gameObject); return(false); } if (pool.prefab == null) { var title = string.Format("{0} (no prefab)", pool.name); var style = new GUIStyle(EditorStyles.boldLabel); style.normal.textColor = Color.red; EditorGUILayout.LabelField(title, style ); } else { var style = new GUIStyle(EditorStyles.label); style.normal.textColor = Color.green; pool.name = pool.prefab.name; EditorGUILayout.LabelField(pool.name, style ); } if (GUILayout.Button("Go >", EditorToolkit.GoButtonLayoutOption())) { Selection.activeGameObject = pool.gameObject; } EditorGUILayout.EndHorizontal(); return(true); }
private void ShowGroup(Group group) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("X", EditorToolkit.CloseButtonLayoutOption())) { GameObject.DestroyImmediate(group.gameObject); return; } group.gameObject.name = EditorGUILayout.TextField( group.gameObject.name, EditorToolkit.BoundaryGroupSytle(group.color) ); if (GUILayout.Button("Go >", EditorToolkit.GoButtonLayoutOption())) { Selection.activeGameObject = group.gameObject; } EditorGUILayout.EndHorizontal(); }
private void DrawOperations() { showOps = EditorToolkit.DrawTitleFoldOut(showOps, "Operations"); if (showOps) { EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Mass Apply", GUILayout.MinWidth(80f)); massApplyPart = EditorGUILayout.Popup(massApplyPart, new[] { "None", "X", "Y", "Z" }, GUILayout.MinWidth(60f)); massApplyValue = EditorGUILayout.FloatField(massApplyValue, GUILayout.MinWidth(50f)); if (GUILayout.Button("Go", EditorToolkit.GoButtonLayoutOption())) { MassApply(massApplyPart, massApplyValue); } EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel--; } }