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();
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        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();
        }