/// <summary> /// Draws the zone settings /// </summary> private void DrawSettings() { zone.gameObject.name = EditorGUILayout.TextField("Name", zone.gameObject.name); zone.color = EditorGUILayout.ColorField("Color", zone.color); zone.triggerType = (Zone.ZoneTriggerTypes)EditorGUILayout.EnumPopup("Trigger Type", zone.triggerType); if (zone.triggerType == Zone.ZoneTriggerTypes.SendMessage) { EditorToolkit.DrawSeparator(); EditorGUILayout.Space(); EditorGUI.indentLevel++; zone.messageReceiver = (GameObject)EditorGUILayout.ObjectField("Message Receiver", zone.messageReceiver, typeof(GameObject), true); zone.RequireReceivers = EditorGUILayout.Toggle("Require Receivers", zone.RequireReceivers); zone.MessageEnterHandler = EditorGUILayout.TextField("OnEnter Handler", zone.MessageEnterHandler); zone.MessageStayHandler = EditorGUILayout.TextField("OnStay Handler", zone.MessageStayHandler); zone.MessageExitHandler = EditorGUILayout.TextField("OnExit Handler", zone.MessageExitHandler); EditorGUI.indentLevel--; EditorToolkit.DrawSeparator(); } else { EditorToolkit.DrawSeparator(); EditorGUILayout.Space(); EditorGUI.indentLevel++; EditorGUILayout.HelpBox( "You must provide your own component on this game object to handle OnTriggerEnter, OnTriggerStay and/or OnTriggerExit", MessageType.Info ); EditorGUI.indentLevel--; EditorToolkit.DrawSeparator(); } }
/// <summary> /// Unity3D OnInspectorGUI event /// </summary> public override void OnInspectorGUI() { EditorToolkit.DrawTitle("Unity Design Tools"); DrawControlPanel(); EditorToolkit.DrawSeparator(); DrawSupportInfo(); }
public override void OnInspectorGUI() { EditorToolkit.DrawTitle("Zone Controller"); DrawToolbar(); EditorToolkit.DrawSeparator(); DrawZones(); EditorToolkit.DrawSeparator(); EditorToolkit.DrawFooter(); }
public override void OnInspectorGUI() { Tools.current = Tool.None; EditorToolkit.DrawTitle("Boundaries Controller"); ShowToolbar(); EditorToolkit.DrawSeparator(); ShowGroups(); EditorToolkit.DrawSeparator(); EditorToolkit.DrawFooter(); }
private void DrawSegments() { showSegments = EditorToolkit.DrawTitleFoldOut(showSegments, "Segments"); if (showSegments) { EditorGUI.indentLevel++; if (group.segments.Count > 0) { for (int i = 0; i < group.segments.Count; i++) { EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); group.segments[i].name = EditorGUILayout.TextField(group.segments[i].name); if (GUILayout.Button("X", EditorToolkit.CloseButtonLayoutOption())) { group.segments.RemoveAt(i); return; } EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel++; group.segments[i].start = EditorGUILayout.Vector3Field("Start", group.segments[i].start); if (group.segments.Count - 1 == i && !group.isClosed) { group.segments[i].end = EditorGUILayout.Vector3Field("End", group.segments[i].end); } EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.indentLevel--; } } else { EditorGUILayout.HelpBox("No segments. Click Add Segment in the toolbar or use the SceneView click-to-create method.", MessageType.Info); } EditorGUI.indentLevel--; EditorToolkit.DrawSeparator(); } }
/// <summary> /// Unity3D OnInspectorGUI event /// </summary> public override void OnInspectorGUI() { RestrictColliderSettings(); GUI.changed = false; EditorToolkit.DrawTitle("Zone"); DrawToolbar(); EditorToolkit.DrawSeparator(); DrawSettings(); EditorToolkit.DrawFooter(); if (GUI.changed) { EditorUtility.SetDirty(target); } }
public override void OnInspectorGUI() { Tools.current = Tool.None; GUI.changed = false; EditorToolkit.DrawTitle("Pool"); DrawToolbar(); EditorToolkit.DrawSeparator(); pool.prefab = EditorGUILayout.ObjectField("Prefab", pool.prefab, typeof(GameObject), false) as GameObject; if (pool.prefab) { pool.name = string.Format("pool-{0}", pool.prefab.name); } pool.size = EditorGUILayout.IntField("Pool Size", pool.size); pool.limit = EditorGUILayout.Toggle("Limit Growth", pool.limit); if (pool.limit) { pool.limitSize = EditorGUILayout.IntField("Limit Size", pool.limitSize); pool.suppressLimitErrors = EditorGUILayout.Toggle("Ignore Limit Errors", pool.suppressLimitErrors); if (pool.limitSize < pool.size) { pool.limitSize = pool.size; } } pool.shrinkBack = EditorGUILayout.Toggle("Shrink Back", pool.shrinkBack); pool.hideInHierarchy = EditorGUILayout.Toggle("Hide in Hierarchy", pool.hideInHierarchy); EditorToolkit.DrawSeparator(); EditorToolkit.DrawFooter(); if (GUI.changed) { EditorUtility.SetDirty(pool); } }
public override void OnInspectorGUI() { Tools.current = Tool.None; GUI.changed = false; EditorToolkit.DrawTitle("Pool Controller"); DrawToolbar(); if (!controller) { return; // handle a DestroyAll call } EditorToolkit.DrawSeparator(); DrawPools(); EditorToolkit.DrawSeparator(); EditorToolkit.DrawFooter(); if (GUI.changed) { EditorUtility.SetDirty(controller); } }