Beispiel #1
0
        public override void DrawInspector(PuppeteerPlanVisualiser _visualiser)
        {
            PuppeteerEditorGUIHelper.DrawGraphInspectorHeader(PuppeteerEditorResourceLoader.GoalIcon32.texture, "Goal", GetContentTypeName());

            EditorGUILayout.Space();
            PuppeteerEditorGUIHelper.DrawDivider();
            EditorGUILayout.Space();

            _visualiser.ShowGoalUtilityFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowGoalUtilityFoldout, "Utility");
            if (_visualiser.ShowGoalUtilityFoldout)
            {
                ++EditorGUI.indentLevel;
                PuppeteerEditorGUIHelper.DrawHorizontal("Base Utility", m_GoalDescription.BaseUtility.ToString());

                ++EditorGUI.indentLevel;
                foreach (var utilityPart in m_GoalDescription.UtilityParts)
                {
                    EditorGUILayout.LabelField(string.Format("{0} {1} * {2}", PuppeteerEditorHelper.UtilityOperatorToString(utilityPart.UtilityOperator),
                                                             utilityPart.WorldStateName.ToString(), utilityPart.CurveMultiplier));
                }
                --EditorGUI.indentLevel;

                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            _visualiser.ShowGoalPartsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowGoalPartsFoldout, "Goal Parts");
            if (_visualiser.ShowGoalPartsFoldout)
            {
                ++EditorGUI.indentLevel;
                foreach (var goalPart in m_GoalDescription.GoalParts)
                {
                    PuppeteerEditorGUIHelper.DrawHorizontal(goalPart.Key, goalPart.Value.ToString());
                }
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            EditorGUILayout.Space();
            PuppeteerEditorGUIHelper.DrawDivider();
            EditorGUILayout.Space();

            if (GUILayout.Button("Open Configuration"))
            {
                var window = PuppeteerConfiguratorWindow.CreateWindow();
                window.OpenEntryInTabOfType <GoalView>(m_GoalDescription.GUID);
            }
        }
Beispiel #2
0
        public override void DrawInspector(PuppeteerPlanVisualiser _visualiser)
        {
            PuppeteerEditorGUIHelper.DrawGraphInspectorHeader(PuppeteerEditorResourceLoader.ActionIcon32.texture, "Action", GetContentTypeName());
            DrawNodeInfo();

            _visualiser.ShowActionUtilityFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowActionUtilityFoldout, "Utility");
            if (_visualiser.ShowActionUtilityFoldout)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.LabelField(m_ActionDescription.BaseUtility.ToString());
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            _visualiser.ShowActionPreconditionFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowActionPreconditionFoldout, "Preconditions");
            if (_visualiser.ShowActionPreconditionFoldout)
            {
                ++EditorGUI.indentLevel;
                if (m_ActionDescription.Preconditions.Length == 0)
                {
                    EditorGUILayout.LabelField("none");
                }
                else
                {
                    foreach (var precondition in m_ActionDescription.Preconditions)
                    {
                        PuppeteerEditorGUIHelper.DrawHorizontal(precondition.Key, precondition.Value.ToString());
                    }
                }
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            _visualiser.ShowActionEffectsFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowActionEffectsFoldout, "Effects");
            if (_visualiser.ShowActionEffectsFoldout)
            {
                ++EditorGUI.indentLevel;
                foreach (var effect in m_ActionDescription.Effects)
                {
                    PuppeteerEditorGUIHelper.DrawHorizontal(effect.Key, effect.Value.ToString());
                }
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            _visualiser.ShowActionGoalWorldStateAtNodeFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowActionGoalWorldStateAtNodeFoldout, "Goal World State at Node");
            if (_visualiser.ShowActionGoalWorldStateAtNodeFoldout)
            {
                ++EditorGUI.indentLevel;
                foreach (KeyValuePair <string, object> goalWorldStateAtNodePair in m_HierarchyNode.GetSortedGoalWorldStateAtNode())
                {
                    PuppeteerEditorGUIHelper.DrawHorizontal(goalWorldStateAtNodePair.Key, goalWorldStateAtNodePair.Value.ToString());
                }
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            _visualiser.ShowActionWorldStateAtNodeFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(_visualiser.ShowActionWorldStateAtNodeFoldout, "Total Remaining Preconditions at Node");
            if (_visualiser.ShowActionWorldStateAtNodeFoldout)
            {
                ++EditorGUI.indentLevel;
                if (m_HierarchyNode.GetSortedRemainingPreconditions().Count == 0)
                {
                    EditorGUILayout.LabelField("none");
                }
                else
                {
                    foreach (KeyValuePair <string, object> remainingPreconditions in m_HierarchyNode.GetSortedRemainingPreconditions())
                    {
                        PuppeteerEditorGUIHelper.DrawHorizontal(remainingPreconditions.Key, remainingPreconditions.Value.ToString());
                    }
                }
                --EditorGUI.indentLevel;
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            EditorGUILayout.Space();
            PuppeteerEditorGUIHelper.DrawDivider();
            EditorGUILayout.Space();

            if (GUILayout.Button("Open Configuration"))
            {
                var window = PuppeteerConfiguratorWindow.CreateWindow();
                window.OpenEntryInTabOfType <ActionView>(m_ActionDescription.GUID);
            }
        }