コード例 #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            if (editDescription.boolValue)
            {
                UnityEditor.EditorGUILayout.PropertyField(Description);
            }
            else
            if (!string.IsNullOrEmpty(Description.stringValue))
            {
                MalbersEditor.DrawDescription(Description.stringValue);
            }

            UnityEditor.EditorGUILayout.BeginHorizontal(UnityEditor.EditorStyles.helpBox);
            UnityEditor.EditorGUILayout.PropertyField(value, GUILayout.MinWidth(60));
            UnityEditor.EditorGUIUtility.labelWidth = 18;
            UnityEditor.EditorGUILayout.PropertyField(Index, GUILayout.Width(50));
            UnityEditor.EditorGUIUtility.labelWidth = 0;
            ShowEvents.boolValue = GUILayout.Toggle(ShowEvents.boolValue, new GUIContent("", "Show Events"), UnityEditor.EditorStyles.miniButton, GUILayout.Width(15));
            UnityEditor.EditorGUILayout.EndHorizontal();

            if (ShowEvents.boolValue)
            {
                DrawEvents();
            }
            serializedObject.ApplyModifiedProperties();
        }
コード例 #2
0
ファイル: MessagesEd.cs プロジェクト: juanibar10/WOTW
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Send Messages to all the MonoBehaviours that uses the Interface |IAnimatorListener| ");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    MalbersEditor.DrawScript(script);

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    list.DoLayoutList();
                    EditorGUILayout.EndVertical();

                    var UseSendMessage = serializedObject.FindProperty("UseSendMessage");
                    UseSendMessage.boolValue = EditorGUILayout.ToggleLeft(new GUIContent("Use Send Message", "Uses the SendMessage() instead"), UseSendMessage.boolValue);
                    var nextFrame = serializedObject.FindProperty("nextFrame");
                    nextFrame.boolValue = EditorGUILayout.ToggleLeft(new GUIContent("Next Frame", "Send the Message the frame after"), nextFrame.boolValue);
                }

                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Messages Inspector");
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Mobile Joystick Logic");


            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    if (MalbersEditor.Foldout(AxisEditor, "Axis Properties"))
                    {
                        EditorGUILayout.BeginHorizontal();
                        {
                            MalbersEditor.BoolButton(invertX, new GUIContent("Invert X"));
                            MalbersEditor.BoolButton(invertY, new GUIContent("Invert Y"));
                            MalbersEditor.BoolButton(Relative, new GUIContent("Drag"));
                        }
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.PropertyField(deathpoint);
                        EditorGUILayout.PropertyField(sensitivityX);
                        EditorGUILayout.PropertyField(sensitivityY);
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    if (MalbersEditor.Foldout(ReferencesEditor, "References"))
                    {
                        EditorGUILayout.PropertyField(axisValue);
                        EditorGUILayout.PropertyField(pressed);
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EventsEditor.boolValue = MalbersEditor.Foldout(EventsEditor, "Events");

                    if (EventsEditor.boolValue)
                    {
                        EditorGUILayout.PropertyField(OnJoystickDown);
                        EditorGUILayout.PropertyField(OnJoystickUp);
                        EditorGUILayout.PropertyField(OnJoystickPressed);
                        EditorGUILayout.Space();
                        EditorGUILayout.PropertyField(OnAxisChange);
                        EditorGUILayout.PropertyField(OnXAxisChange);
                        EditorGUILayout.PropertyField(OnYAxisChange);
                    }
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
        }
コード例 #4
0
ファイル: MInputEditor.cs プロジェクト: DevilN31/Wilde-Chase
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Inputs for conecting with Scripts");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUI.BeginChangeCheck();
                {
#if REWIRED
                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("PlayerID"), new GUIContent("Player ID", "Rewired Player ID"));
                    EditorGUILayout.EndVertical();
#endif

                    list.DoLayoutList();

                    var Index = list.index;

                    if (Index != -1)
                    {
                        SerializedProperty Element = inputs.GetArrayElementAtIndex(Index);
                        DrawInputEvents(Element, Index);
                    }

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUI.indentLevel++;
                        showInputEvents.boolValue = EditorGUILayout.Foldout(showInputEvents.boolValue, "Events (Enable/Disable Malbers Input)");
                        EditorGUI.indentLevel--;

                        if (showInputEvents.boolValue)
                        {
                            EditorGUILayout.PropertyField(serializedObject.FindProperty("OnInputEnabled"));
                            EditorGUILayout.PropertyField(serializedObject.FindProperty("OnInputDisabled"));
                        }
                    }
                    EditorGUILayout.EndVertical();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(target, "MInput Inspector");
                }
                serializedObject.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #5
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("This Script Enable/Disable Layers in the Transition times");

            EditorGUI.BeginChangeCheck();
            list.DoLayoutList();

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Layers Inspector");
            }
            serializedObject.ApplyModifiedProperties();
        }
コード例 #6
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Connects the INPUTS to the Controller System");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);
                EditorGUI.BeginChangeCheck();
                {
                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    EditorGUILayout.PropertyField(IgnoreOnPause);
                    EditorGUILayout.EndVertical();

                    DrawRewired();

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(Horizontal, new GUIContent("Horizontal", "Axis for the Horizontal Movement"));
                        EditorGUILayout.PropertyField(Vertical, new GUIContent("Vertical", "Axis for the Forward/Backward Movement"));

                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.PropertyField(UpDown, new GUIContent("UpDown", "Axis for the Up and Down Movement"));

                        if (GUILayout.Button(new GUIContent("Create", "Creates 'UpDown' on the Input Manager"), GUILayout.Width(55)))
                        {
                            CreateInputAxe();
                        }

                        EditorGUILayout.EndHorizontal();
                    }
                    EditorGUILayout.EndVertical();

                    DrawListAnEvents();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(target, "Malbers Input Inspector");
                    EditorUtility.SetDirty(target);
                }



                serializedObject.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #7
0
ファイル: MDamageable.cs プロジェクト: gylesis/Space-Maze
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("Allows the Animal React and Receive damage from external sources");
            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            if (M.transform.parent != null)
            {
                EditorGUILayout.PropertyField(Root);
            }
            EditorGUILayout.PropertyField(reaction);
            EditorGUILayout.PropertyField(stats);
            EditorGUILayout.PropertyField(multiplier);
            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(events, true);
            EditorGUI.indentLevel--;
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
        }
コード例 #8
0
ファイル: MInputEditor.cs プロジェクト: gylesis/Space-Maze
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Inputs for conecting with Scripts");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUI.BeginChangeCheck();
                {
                    EditorGUILayout.PropertyField(IgnoreOnPause);
                    DrawRewired();
                    DrawListAnEvents();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(target, "MInput Inspector");
                }
                serializedObject.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #9
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Modify the Rigidbody Constraints attached to this Animator");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnEnterDrag"));
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    OnEnter.boolValue = EditorGUILayout.Toggle("On Enter", OnEnter.boolValue, EditorStyles.radioButton);
                    OnExit.boolValue  = !OnEnter.boolValue;

                    OnExit.boolValue  = EditorGUILayout.Toggle("On Exit", OnExit.boolValue, EditorStyles.radioButton);
                    OnEnter.boolValue = !OnExit.boolValue;
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Constraints  ", EditorStyles.boldLabel, GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("X", EditorStyles.boldLabel, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("Y", EditorStyles.boldLabel, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("     Z", EditorStyles.boldLabel, GUILayout.MaxWidth(35));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Position ", GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        PosX.boolValue = EditorGUILayout.Toggle(PosX.boolValue, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        PosY.boolValue = EditorGUILayout.Toggle(PosY.boolValue, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        PosZ.boolValue = EditorGUILayout.Toggle(PosZ.boolValue, GUILayout.MaxWidth(15));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Rotation ", GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        RotX.boolValue = EditorGUILayout.Toggle(RotX.boolValue, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        RotY.boolValue = EditorGUILayout.Toggle(RotY.boolValue, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        RotZ.boolValue = EditorGUILayout.Toggle(RotZ.boolValue, GUILayout.MaxWidth(15));
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
コード例 #10
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Connects the INPUTS to the Locomotion System. The 'Name' is actually the Properties to access");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUI.BeginChangeCheck();
#if REWIRED
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("PlayerID"), new GUIContent("Player ID", "Rewired Player ID"));
                EditorGUILayout.EndVertical();
#endif

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("Horizontal"), new GUIContent("Horizontal", "Axis for the Horizontal Movement"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("Vertical"), new GUIContent("Vertical", "Axis for the Forward/Backward Movement"));

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("UpDown"), new GUIContent("UpDown", "Axis for the Up and Down Movement"));
                    if (GUILayout.Button(new GUIContent("Create", "Creates 'UpDown' on the Input Manager"), GUILayout.Width(50)))
                    {
                        CreateInputAxe();
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();

                list.DoLayoutList();
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("alwaysForward"), new GUIContent("Always Forward", "The Character will move forward forever"));
                }
                EditorGUILayout.EndVertical();

                var Index = list.index;

                if (Index != -1)
                {
                    SerializedProperty Element = inputs.GetArrayElementAtIndex(Index);
                    DrawInputEvents(Element, Index);
                }

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUI.indentLevel++;
                    M.showInputEvents = EditorGUILayout.Foldout(M.showInputEvents, "Events (Enable/Disable Malbers Input)");
                    EditorGUI.indentLevel--;

                    if (M.showInputEvents)
                    {
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("OnInputEnabled"));
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("OnInputDisabled"));
                    }
                }
                EditorGUILayout.EndVertical();


                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(target, "Malbers Input Inspector");
                    EditorUtility.SetDirty(target);
                }



                serializedObject.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #11
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Modify the Rigidbody Constraints attached to this Animator");

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnEnterDrag"));
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    M.OnEnter = EditorGUILayout.Toggle("On Enter", M.OnEnter, EditorStyles.radioButton);
                    if (M.OnEnter)
                    {
                        M.OnExit = false;
                    }
                    else
                    {
                        M.OnExit = true;
                    }
                    M.OnExit = EditorGUILayout.Toggle("On Exit", M.OnExit, EditorStyles.radioButton);

                    if (M.OnExit)
                    {
                        M.OnEnter = false;
                    }
                    else
                    {
                        M.OnEnter = true;
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Constraints  ", EditorStyles.boldLabel, GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("X", EditorStyles.boldLabel, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("Y", EditorStyles.boldLabel, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField("     Z", EditorStyles.boldLabel, GUILayout.MaxWidth(35));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Position ", GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.PosX = EditorGUILayout.Toggle(M.PosX, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.PosY = EditorGUILayout.Toggle(M.PosY, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.PosZ = EditorGUILayout.Toggle(M.PosZ, GUILayout.MaxWidth(15));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Rotation ", GUILayout.MaxWidth(105));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.RotX = EditorGUILayout.Toggle(M.RotX, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.RotY = EditorGUILayout.Toggle(M.RotY, GUILayout.MaxWidth(15));
                        EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(15));
                        M.RotZ = EditorGUILayout.Toggle(M.RotZ, GUILayout.MaxWidth(15));
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();


            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Rigid Constraint Inspector");
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #12
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Dismember Limbs... To enable it, call the public methods for 'Dismember'");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    MalbersEditor.DrawScript(script);

                    list.DoLayoutList();


                    if (list.index != -1 && M.bodyParts.Count > list.index)
                    {
                        BodyPart           item    = M.bodyParts[list.index];
                        SerializedProperty Element = LimbList.GetArrayElementAtIndex(list.index);

                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            EditorGUILayout.BeginHorizontal();
                            {
                                EditorGUIUtility.labelWidth = 20;

                                EditorGUILayout.LabelField(item.name, EditorStyles.boldLabel);
                                EditorGUIUtility.labelWidth = 0;

                                EditorGUI.BeginDisabledGroup(true);
                                item.dismembered = GUILayout.Toggle(item.dismembered, new GUIContent(!item.dismembered ? "Not Used" : "Used", "This variable gets enabled when the limb is intantiated... that way the dismembering will be used one time"), EditorStyles.miniButton);
                                EditorGUI.EndDisabledGroup();

                                if (M.bodyParts[list.index].member != null)
                                {
                                    item.Instantiate = GUILayout.Toggle(item.Instantiate, new GUIContent("Instantiate", "if True the separated limb will be instantiated... else is already on scene and it will be enabled"), EditorStyles.miniButton);
                                }
                            }
                            EditorGUILayout.EndHorizontal();

                            Limb member = M.bodyParts[list.index].member;

                            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                            {
                                EditorGUILayout.PropertyField(Element.FindPropertyRelative("AttachedLimb"), new GUIContent("Attached Limb", "The Attached limb on the Animal.. this gameobject will be hide after is dismemered"), true);
                                if (member != null) //If theres a member on it
                                {
                                    EditorGUILayout.PropertyField(Element.FindPropertyRelative("life"), new GUIContent("Destroy Limb", "Seconds before destroy the limb object"), true);
                                    if (Element.FindPropertyRelative("life").floatValue <= 0)
                                    {
                                        EditorGUILayout.HelpBox("Life <= 0 , the limb wont be destroy", MessageType.Warning);
                                    }
                                }
                            }
                            EditorGUILayout.EndVertical();



                            if (member != null) //If theres a member on it
                            {
                                EditorGUILayout.BeginVertical(MalbersEditor.StyleGreen);
                                EditorGUILayout.HelpBox("[Attached Bones] Bones on the animal \n[Dismember Bones] Bones on the Detached Limb\n\n The order of elements of both List must match", MessageType.None);
                                EditorGUILayout.EndVertical();


                                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                MalbersEditor.Arrays(Element.FindPropertyRelative("AttachedLimbBones"), new GUIContent("Attached Bones", "Attached Limb Bones... They are use for alinging the Dismembered bones"));
                                EditorGUILayout.EndVertical();


                                MemberScript = new SerializedObject(member);


                                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                {
                                    EditorGUI.BeginDisabledGroup(true);
                                    MalbersEditor.Arrays(MemberScript.FindProperty("Bones"), new GUIContent("Dismember Bones", "The bones has to be on the same order than the Attached bones on the Dismember Script"));
                                    EditorGUI.EndDisabledGroup();
                                }
                                EditorGUILayout.EndVertical();
                            }
                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("OnDismember"), new GUIContent("On Dismember", "Invoked when Dismember is called"), true);
                        }
                        EditorGUILayout.EndVertical();
                    }
                }

                if (changer)
                {
                    EditorGUILayout.BeginVertical(MalbersEditor.StyleGreen);
                    {
                        EditorGUILayout.HelpBox("This animal has [MaterialChanger] component.\nSet a Material-Item name to match the materials on the Dismembered Limbs ", MessageType.None);
                    }
                    EditorGUILayout.EndVertical();


                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("MaterialItemName"), new GUIContent("Material-Item", "The Current Material Item on the Animal to Update the Limbs Material Items"));
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndVertical();
            }

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Dismember ChangeChanged");
                //EditorUtility.SetDirty(target);
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #13
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Notifies the Animator Asociate Scripts\nWorks exactly like Animation Events");


            EditorGUI.BeginChangeCheck();

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);

                EditorGUI.indentLevel++;
                if (listOnEnter.count > 0)
                {
                    OnEnter = true;
                }
                OnEnter = EditorGUILayout.Foldout(OnEnter, "On Enter (" + listOnEnter.count + ")");
                EditorGUI.indentLevel--;

                if (OnEnter)
                {
                    listOnEnter.DoLayoutList();
                }

                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUI.indentLevel++;
                if (listOnExit.count > 0)
                {
                    OnExit = true;
                }
                OnExit = EditorGUILayout.Foldout(OnExit, "On Exit (" + listOnExit.count + ")");
                EditorGUI.indentLevel--;

                if (OnExit)
                {
                    listOnExit.DoLayoutList();
                }

                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUI.indentLevel++;
                if (listOnTime.count > 0)
                {
                    OnTime = true;
                }
                OnTime = EditorGUILayout.Foldout(OnTime, "On Time (" + listOnTime.count + ")");
                EditorGUI.indentLevel--;

                if (OnTime)
                {
                    listOnTime.DoLayoutList();
                }

                EditorGUILayout.EndVertical();
                EditorGUILayout.PropertyField(UseSendMessage, new GUIContent("Use Send Message", "Uses the SendMessage() instead"));
                EditorGUILayout.PropertyField(NormalizeTime, new GUIContent("NomalizeState", "Update State Time will be normalized "));
                EditorGUILayout.PropertyField(debug);
            }

            EditorGUILayout.EndVertical();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Message Behaviour Inspector");
                //EditorUtility.SetDirty(target);
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #14
0
ファイル: StatsEd.cs プロジェクト: gylesis/Space-Maze
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Stats Manager");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                if (Application.isPlaying)
                {
                    EditorGUI.BeginDisabledGroup(true);
                    {
                        if (M.PinnedStat != null)
                        {
                            EditorGUILayout.ObjectField("Pin Stat: ", (StatID)M.PinnedStat.ID, typeof(StatID), false);
                        }
                        else
                        {
                            EditorGUILayout.LabelField("Pin Stat: NULL ");
                        }
                    }
                    EditorGUI.EndDisabledGroup();
                }

                list.DoLayoutList();

                if (list.index != -1)
                {
                    var element    = statList.GetArrayElementAtIndex(list.index);
                    var id         = element.FindPropertyRelative("ID");
                    var ShowEvents = element.FindPropertyRelative("ShowEvents");
                    var BelowValue = element.FindPropertyRelative("Below");
                    var AboveValue = element.FindPropertyRelative("Above");

                    var Value    = element.FindPropertyRelative("value");
                    var MaxValue = element.FindPropertyRelative("maxValue");
                    var MinValue = element.FindPropertyRelative("minValue");

                    var resetTo    = element.FindPropertyRelative("resetTo");
                    var InmuneTime = element.FindPropertyRelative("InmuneTime");

                    var Regenerate    = element.FindPropertyRelative("regenerate");
                    var RegenRate     = element.FindPropertyRelative("RegenRate");
                    var RegenWaitTime = element.FindPropertyRelative("RegenWaitTime");

                    var Degenerate    = element.FindPropertyRelative("degenerate");
                    var DegenRate     = element.FindPropertyRelative("DegenRate");
                    var DegenWaitTime = element.FindPropertyRelative("DegenWaitTime");
                    var multiplier    = element.FindPropertyRelative("multiplier");


                    var OnValueChange           = element.FindPropertyRelative("OnValueChange");
                    var OnValueChangeNormalized = element.FindPropertyRelative("OnValueChangeNormalized");
                    var OnStatFull   = element.FindPropertyRelative("OnStatFull");
                    var OnStatEmpty  = element.FindPropertyRelative("OnStatEmpty");
                    var OnRegenerate = element.FindPropertyRelative("OnRegenerate");
                    var OnDegenerate = element.FindPropertyRelative("OnDegenerate");
                    var OnStatBelow  = element.FindPropertyRelative("OnStatBelow");
                    var OnStatAbove  = element.FindPropertyRelative("OnStatAbove");



                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                    {
                        EditorGUIUtility.labelWidth = 60;
                        EditorGUILayout.PropertyField(Value, new GUIContent("Value", "Current Value of the Stat"));
                        EditorGUILayout.PropertyField(multiplier, new GUIContent("Mult", "Stat Multiplier to be used when the value is modified"));
                        EditorGUIUtility.labelWidth = 0;
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                    {
                        EditorGUIUtility.labelWidth = 55;
                        EditorGUILayout.PropertyField(MinValue, new GUIContent("Min", "Minimun value of the Stat"));
                        EditorGUILayout.PropertyField(MaxValue, new GUIContent("Max", "Maximum value of the Stat"));
                        EditorGUIUtility.labelWidth = 0;
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(Regenerate, new GUIContent("Regenerate", "Can the Stat Regenerate over time?"));
                        EditorGUILayout.PropertyField(RegenRate, new GUIContent("Rate", "Regeneration Rate, how fast/Slow the Stat will regenerate"));
                        EditorGUILayout.PropertyField(RegenWaitTime, new GUIContent("Wait Time", "After the Stat is modified, the time to wait to start regenerating"));
                    }
                    EditorGUILayout.EndVertical();


                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(Degenerate, new GUIContent("Degenerate", "Can the Stat Degenerate over time?"));
                        EditorGUILayout.PropertyField(DegenRate, new GUIContent("Rate", "Degeneration Rate, how fast/Slow the Stat will Degenerate"));
                        EditorGUILayout.PropertyField(DegenWaitTime, new GUIContent("Wait Time", "After the Stat is modified, the time to wait to start degenerating"));
                    }
                    EditorGUILayout.EndVertical();

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(resetTo, new GUIContent("Reset To", "When called the Funtion RESET()  it will reset to the Min Value or the Max Value"));
                        EditorGUILayout.PropertyField(InmuneTime, new GUIContent("Inmune Time", "If greater than zero, the Stat cannot be modify until the inmune time have passed"));

                        if (Application.isPlaying)
                        {
                            EditorGUI.BeginDisabledGroup(true);
                            EditorGUILayout.Toggle("Is Inmune", M.stats[list.index].IsInmune);
                            EditorGUI.EndDisabledGroup();
                        }
                    }
                    EditorGUILayout.EndVertical();


                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        if (MalbersEditor.Foldout(ShowEvents, "Events"))
                        {
                            string name = "Stat";

                            if (id.objectReferenceValue != null)
                            {
                                name = id.objectReferenceValue.name;
                            }

                            EditorGUILayout.PropertyField(OnValueChange, new GUIContent("On " + name + " change"));
                            EditorGUILayout.PropertyField(OnValueChangeNormalized, new GUIContent("On " + name + " change normalized"));
                            MalbersEditor.DrawSplitter();
                            EditorGUILayout.Space();
                            EditorGUILayout.PropertyField(OnStatFull, new GUIContent("On " + name + " full "));
                            EditorGUILayout.PropertyField(OnStatEmpty, new GUIContent("On " + name + " empty "));
                            EditorGUILayout.PropertyField(OnRegenerate, new GUIContent("On " + name + " Regenerate "));
                            EditorGUILayout.PropertyField(OnDegenerate, new GUIContent("On " + name + " Degenerate "));

                            MalbersEditor.DrawSplitter();
                            EditorGUILayout.Space();
                            EditorGUILayout.BeginHorizontal();
                            {
                                EditorGUIUtility.labelWidth = 55;
                                EditorGUILayout.PropertyField(BelowValue, new GUIContent("Below", "Used to Check when the Stat is below this value"));
                                EditorGUILayout.PropertyField(AboveValue, new GUIContent("Above", "Used to Check when the Stat is Above this value"));
                                EditorGUIUtility.labelWidth = 0;
                            }
                            EditorGUILayout.EndHorizontal();
                            EditorGUILayout.PropertyField(OnStatBelow, new GUIContent("On " + name + " Below " + BelowValue.floatValue.ToString("F1")));
                            EditorGUILayout.PropertyField(OnStatAbove, new GUIContent("On " + name + " Above " + AboveValue.floatValue.ToString("F1")));
                        }
                    }
                    EditorGUILayout.EndVertical();
                }
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
コード例 #15
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Use to animate a transform to this values");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    MalbersEditor.DrawScript(script);

                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("animTrans"), new GUIContent("Used for"));
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                    {
                        EditorGUIUtility.labelWidth = 50;
                        var type = My.animTrans == TransformAnimation.AnimTransType.TransformAnimation;
                        My.time  = EditorGUILayout.FloatField(new GUIContent(type ? "Time" : "Mount", type ? "Duration of the animation" : "Scale for the Mount Animation on the MountTriger Script"), My.time);
                        My.delay = EditorGUILayout.FloatField(new GUIContent(type ? "Delay" : "Dismount", type ? "Delay before the animation is started" : "Scale for the Dismount Animation on the MountTriger Script"), My.delay);
                        EditorGUIUtility.labelWidth = 0;
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                    {
                        My.UsePosition = GUILayout.Toggle(My.UsePosition, new GUIContent("Position"), EditorStyles.miniButton);
                        My.UseRotation = GUILayout.Toggle(My.UseRotation, new GUIContent("Rotation"), EditorStyles.miniButton);
                        My.UseScale    = GUILayout.Toggle(My.UseScale, new GUIContent("Scale"), EditorStyles.miniButton);
                    }
                    EditorGUILayout.EndHorizontal();

                    if (My.UsePosition)
                    {
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            EditorGUILayout.BeginHorizontal();
                            {
                                My.SeparateAxisPos = GUILayout.Toggle(My.SeparateAxisPos, new GUIContent("|", "Separated Axis"), EditorStyles.miniButton);
                                EditorGUILayout.LabelField("Position", GUILayout.MinWidth(50), GUILayout.MaxWidth(100));
                                My.Position = EditorGUILayout.Vector3Field("", My.Position, GUILayout.MinWidth(120));
                                if (!My.SeparateAxisPos)
                                {
                                    My.PosCurve = EditorGUILayout.CurveField(My.PosCurve, GUILayout.MinWidth(30));
                                }
                            }
                            EditorGUILayout.EndHorizontal();

                            if (My.SeparateAxisPos)
                            {
                                EditorGUILayout.BeginHorizontal();
                                {
                                    My.PosXCurve = EditorGUILayout.CurveField(My.PosXCurve, Color.red, new Rect());
                                    My.PosYCurve = EditorGUILayout.CurveField(My.PosYCurve, Color.green, new Rect());
                                    My.PosZCurve = EditorGUILayout.CurveField(My.PosZCurve, Color.blue, new Rect());
                                }
                                EditorGUILayout.EndHorizontal();
                            }
                        }
                        EditorGUILayout.EndVertical();
                    }

                    if (My.UseRotation)
                    {
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            EditorGUILayout.BeginHorizontal();
                            {
                                My.SeparateAxisRot = GUILayout.Toggle(My.SeparateAxisRot, new GUIContent("|", "Separated Axis"), EditorStyles.miniButton);
                                EditorGUILayout.LabelField("Rotation", GUILayout.MinWidth(50), GUILayout.MaxWidth(100));
                                My.Rotation = EditorGUILayout.Vector3Field("", My.Rotation, GUILayout.MinWidth(120));
                                if (!My.SeparateAxisRot)
                                {
                                    My.RotCurve = EditorGUILayout.CurveField(My.RotCurve, GUILayout.MinWidth(30));
                                }
                            }
                            EditorGUILayout.EndHorizontal();

                            if (My.SeparateAxisRot)
                            {
                                EditorGUILayout.BeginHorizontal();
                                {
                                    My.RotXCurve = EditorGUILayout.CurveField(My.RotXCurve, Color.red, new Rect());
                                    My.RotYCurve = EditorGUILayout.CurveField(My.RotYCurve, Color.green, new Rect());
                                    My.RotZCurve = EditorGUILayout.CurveField(My.RotZCurve, Color.blue, new Rect());
                                }
                                EditorGUILayout.EndHorizontal();
                            }
                        }
                        EditorGUILayout.EndVertical();
                    }

                    if (My.UseScale)
                    {
                        EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                        {
                            EditorGUILayout.LabelField("Scale", GUILayout.MinWidth(50), GUILayout.MaxWidth(100));
                            My.Scale      = EditorGUILayout.Vector3Field("", My.Scale, GUILayout.MinWidth(120));
                            My.ScaleCurve = EditorGUILayout.CurveField(My.ScaleCurve, GUILayout.MinWidth(50));
                        }
                        EditorGUILayout.EndHorizontal();
                    }
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Transform Animation Inspector");
                EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }