/// <inheritdoc />
        public override Rect Draw(Rect rect, object currentValue, Action <object> changeValueCallback, GUIContent label)
        {
            EditorGUI.BeginDisabledGroup(EditorConfigurator.Instance.AllowedMenuItemsSettings.GetBehaviorMenuOptions().Any() == false);
            if (EditorDrawingHelper.DrawAddButton(ref rect, "Add Behavior"))
            {
                IList <TestableEditorElements.MenuOption> options = ConvertFromConfigurationOptionsToGenericMenuOptions(EditorConfigurator.Instance.BehaviorsMenuContent.ToList(), currentValue, changeValueCallback);
                TestableEditorElements.DisplayContextMenu(options);
            }
            EditorGUI.EndDisabledGroup();

            if (EditorDrawingHelper.DrawHelpButton(ref rect))
            {
                Application.OpenURL("https://developers.innoactive.de/documentation/creator/latest/articles/innoactive-creator/default-behaviors.html");
            }

            if (EditorConfigurator.Instance.AllowedMenuItemsSettings.GetBehaviorMenuOptions().Any() == false)
            {
                rect.y     += rect.height + EditorDrawingHelper.VerticalSpacing;
                rect.width -= EditorDrawingHelper.IndentationWidth;
                EditorGUI.HelpBox(rect, "Your project does not contain any Behaviors. Either create one or import an Innoactive Creator Component.", MessageType.Error);
                rect.height += rect.height + EditorDrawingHelper.VerticalSpacing;
            }

            return(rect);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override Rect Draw(Rect rect, object currentValue, Action <object> changeValueCallback, GUIContent label)
        {
            if (EditorDrawingHelper.DrawAddButton(ref rect, "Add Transition"))
            {
                ChangeValue(() => new Transition(), () => currentValue, changeValueCallback);
            }

            return(rect);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override Rect Draw(Rect rect, object currentValue, Action <object> changeValueCallback, GUIContent label)
        {
            if (EditorDrawingHelper.DrawAddButton(ref rect, "Add Behavior"))
            {
                IList <TestableEditorElements.MenuOption> options = ConvertFromConfigurationOptionsToGenericMenuOptions(EditorConfigurator.Instance.BehaviorsMenuContent.ToList(), currentValue, changeValueCallback);
                TestableEditorElements.DisplayContextMenu(options);
            }

            return(rect);
        }
        /// <inheritdoc />
        public override Rect Draw(Rect rect, object currentValue, Action <object> changeValueCallback, GUIContent label)
        {
            EditorGUI.DrawRect(new Rect(0, rect.y, rect.width + 8, 1), new Color(26f / 256f, 26f / 256f, 26f / 256f));

            rect = new Rect(rect.x, rect.y - 5, rect.width, rect.height);
            if (EditorDrawingHelper.DrawAddButton(ref rect, "Add Transition"))
            {
                ChangeValue(() => EntityFactory.CreateTransition(), () => currentValue, changeValueCallback);
            }

            return(rect);
        }