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 void DrawZones()
        {
            var zones = controller.GetComponentsInChildren <Zone>();

            EditorGUILayout.Space();
            EditorGUI.indentLevel++;

            if (zones.Length > 0)
            {
                for (int i = 0; i < zones.Length; i++)
                {
                    DrawZone(zones[i]);
                }
            }
            else
            {
                EditorGUILayout.LabelField("no zones defined",
                                           EditorToolkit.ErrorLabelStyle()
                                           );
            }

            EditorGUI.indentLevel--;
        }
Exemple #3
0
        private void ShowGroups()
        {
            var groups = GetChildGroups();

            EditorGUILayout.Space();
            EditorGUI.indentLevel++;

            if (groups.Count > 0)
            {
                for (int i = 0; i < groups.Count; i++)
                {
                    ShowGroup(groups[i]);
                }
            }
            else
            {
                EditorGUILayout.LabelField("no groups defined",
                                           EditorToolkit.ErrorLabelStyle()
                                           );
            }

            EditorGUI.indentLevel--;
        }