Exemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("AI Logic that uses the NavMesh Agent to move the Animal");

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

                Editor_Tabs1.intValue = GUILayout.Toolbar(Editor_Tabs1.intValue, new string[] { "General", "Events", "Debug" });

                int Selection = Editor_Tabs1.intValue;

                if (Selection == 0)
                {
                    ShowGeneral();
                }
                else if (Selection == 1)
                {
                    ShowEvents();
                }
                else if (Selection == 2)
                {
                    ShowDebug();
                }


                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(target, "Animal AI Control Changed");
                }
            }
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("Used for catch when a gameobject enters, stays, or Exit A collider/Trigger");

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

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("active"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("ignoreTriggers"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("hitLayer"), new GUIContent("Hit Layers", "GameObjects to Ignore with this layers"));
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnTrigger_Enter"), new GUIContent("On Trigger Enter"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnTrigger_Stay"), new GUIContent("On Trigger Stay"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnTrigger_Exit"), new GUIContent("On Trigger Exit"));
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 3
0
        // private readonly GUIContent G_DismountMountOnDeath = new GUIContent("Dismount if mount dies", "The Rider will automatically dismount if the Animal Dies");
        #endregion

        public override void OnInspectorGUI()
        {
            MalbersEditor.DrawDescription("Riding Logic");
            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            MalbersEditor.DrawScript(script);

            serializedObject.Update();

            Editor_Tabs1.intValue = GUILayout.Toolbar(Editor_Tabs1.intValue, new string[] { "General", "Events", "Advanced", "Debug" });


            int Selection = Editor_Tabs1.intValue;

            if (Selection == 0)
            {
                DrawGeneral();
            }
            else if (Selection == 1)
            {
                DrawEvents();
            }
            else if (Selection == 2)
            {
                DrawAdvanced();
            }
            else if (Selection == 3)
            {
                DrawDebug();
            }

            serializedObject.ApplyModifiedProperties();
            EditorGUILayout.EndVertical();

            AddMountLayer();
        }
Exemplo n.º 4
0
        private void ShowStates()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.LabelField("Mount/Dismount States", EditorStyles.boldLabel);
                EditorGUILayout.PropertyField(MountOnly, new GUIContent("Mount Only", "The Rider can only Mount when the Animal is on any of these states"));

                if (MountOnly.boolValue)
                {
                    MalbersEditor.Arrays(MountOnlyStates);
                }

                EditorGUILayout.PropertyField(DismountOnly, new GUIContent("Dismount Only", "The Rider can only Dismount when the Animal is on any of these states"));

                if (DismountOnly.boolValue)
                {
                    MalbersEditor.Arrays(DismountOnlyStates);
                }


                EditorGUILayout.PropertyField(ForceDismount, new GUIContent("Force Dismount", "The Rider is forced to dismount when the Animal is on any of these states"));

                if (ForceDismount.boolValue)
                {
                    MalbersEditor.Arrays(ForceDismountStates);
                }
            }
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 5
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Egg Logic");

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

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.HelpBox("Use Baby Dragons or Scale Up the egg", MessageType.None, true);


                        EditorGUILayout.PropertyField(serializedObject.FindProperty("Dragon"), new GUIContent("Dragon", "the Prefab or Gameobject that contains the little dragon"));

                        EditorGUILayout.PropertyField(serializedObject.FindProperty("preHatchOffset"), new GUIContent("Pre-Hatch Offset"));

                        EditorGUILayout.PropertyField(hatchtype, new GUIContent("Hatch Type"));

                        DragonEgg.HatchType ht = (DragonEgg.HatchType)hatchtype.enumValueIndex;

                        switch (ht)
                        {
                        case DragonEgg.HatchType.None:
                            EditorGUILayout.HelpBox("Just Call the Method CrackEgg() to activate it", MessageType.Info, true);
                            break;

                        case DragonEgg.HatchType.Time:
                            EditorGUILayout.PropertyField(time, new GUIContent("Time", "ammount of Seconds to Hatch"));
                            break;

                        case DragonEgg.HatchType.Input:
                            EditorGUILayout.PropertyField(input, new GUIContent("Input", "Input assigned in the InputManager to Hatch"));
                            break;

                        default:
                            break;
                        }
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnEggCrack"), new GUIContent("On Egg Crack", "Invoked When the Egg Crack"));
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Dragon Egg Values Changed");
            }

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 6
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("Brain Logic for the Animal");
            EditorGUILayout.BeginVertical(MTools.StyleGray);
            {
                Editor_Tabs1.intValue = GUILayout.Toolbar(Editor_Tabs1.intValue, Tabs1);


                if (Editor_Tabs1.intValue == 1)
                {
                    DrawReferences();
                }
                else if (Editor_Tabs1.intValue == 0)
                {
                    DrawAIStates();
                }
                else
                {
                    DrawEvents();
                }


                //EditorGUILayout.PropertyField(debug);
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("Guns Weapons Properties");

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                CommonWeaponProperties();

                GunCustomInspector();

                SoundsList();
                EventList();
                CheckWeaponID();
            }
            EditorGUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Gun Inspector");
                EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 9
0
 private void DrawVector3(SerializedProperty Element)
 {
     if (useVector2.boolValue)
     {
         MalbersEditor.DrawLineHelpBox();
         EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseVector2"), new GUIContent("Response V2"));
     }
 }
Exemplo n.º 10
0
 private void DrawSprite(SerializedProperty Element)
 {
     if (useSprite.boolValue)
     {
         MalbersEditor.DrawLineHelpBox();
         EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseSprite"), new GUIContent("Response Sprite"));
         EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseNull"), new GUIContent("Response NULL"));
     }
 }
Exemplo n.º 11
0
        public virtual void PaintInspectorGUI(string title)
        {
            serializedObject.Update();

            EditorGUILayout.BeginVertical(MalbersEditor.StyleBlue);
            EditorGUILayout.HelpBox(title, MessageType.None, true);
            EditorGUILayout.EndVertical();


            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                EditorGUI.BeginDisabledGroup(true);
                MonoScript script = MonoScript.FromScriptableObject(target as ScriptableObject);
                script = (MonoScript)EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false);
                EditorGUI.EndDisabledGroup();

                //EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                //EditorGUILayout.PropertyField(serializedObject.FindProperty("Clone"), new GUIContent("Set to Clone", "The current value"));
                //EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PropertyField(serializedObject.FindProperty("value"), new GUIContent("Value", "The current value"));
                var useEvent = serializedObject.FindProperty("UseEvent");
                useEvent.boolValue = GUILayout.Toggle(useEvent.boolValue, new GUIContent("E", "Enable 'OnValueChanged' Event. It will be invoked only when the value changes"), EditorStyles.miniButton, GUILayout.Width(18));
                EditorGUILayout.EndHorizontal();
                // MalbersEditor.DrawSplitter();

                // EditorGUILayout.EndVertical();

                //  EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("Description"));
                //  EditorGUILayout.EndVertical();

                // EditorGUILayout.BeginVertical(EditorStyles.helpBox);


                //EditorGUILayout.PropertyField(useEvent, new GUIContent("Use Event", "If the value changes the On Value Changed Event will be invoked"));

                //EditorGUI.BeginDisabledGroup(!useEvent.boolValue);

                if (useEvent.boolValue)
                {
                    MalbersEditor.DrawSplitter();
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnValueChanged"));
                }
                // EditorGUILayout.EndVertical();
                // EditorGUI.EndDisabledGroup();
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 12
0
        void AddLayerMountedCombat(UnityEditor.Animations.AnimatorController CurrentAnimator)
        {
            UnityEditor.Animations.AnimatorController MountAnimator = Resources.Load <UnityEditor.Animations.AnimatorController>(M.CombatLayerPath);

            MalbersEditor.AddParametersOnAnimator(CurrentAnimator, MountAnimator);

            foreach (var item in MountAnimator.layers)
            {
                CurrentAnimator.AddLayer(item);
            }
        }
Exemplo n.º 13
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Strafing Logic");

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);

            MalbersEditor.DrawScript(script);

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("active"), new GUIContent("Active", "Enable Disable the Strafing Logic"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("SType"), new GUIContent("Use", "Use Camera or a Target to Calculate the Strafing"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("MainCamera"), new GUIContent("Main Camera", "Use the Main Camera for the Strafe Logic"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("Target"), new GUIContent("Target", "Use a Target for the Strafe Logic"));
            EditorGUILayout.EndVertical();


            //EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            //EditorGUILayout.PropertyField(serializedObject.FindProperty("Gravity"), new GUIContent("Gravity", "Gravity Direction"));
            //EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("Rotate"), new GUIContent("Rotate", "Add extra rotation while on Strafe Mode"));
            EditorGUILayout.PropertyField(serializedObject.FindProperty("SmoothValue"), new GUIContent("SmoothValue", "Smooth Value to the Rotation"));
            EditorGUILayout.EndVertical();


            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.PropertyField(updateAnimator, new GUIContent("Update Animator", "Update Animator with the Parameter"));

            if (M.UpdateAnimator)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("m_StrafeAngle"), new GUIContent("Param Name", "Name of the Parameter on The Animator for the Strafing"));
            }
            EditorGUILayout.EndVertical();


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

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 14
0
        private void DrawAIStates()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.BeginHorizontal();
            MTools.DrawScriptableObject(currentState, false);
            MalbersEditor.DrawDebugIcon(debug);
            EditorGUILayout.EndHorizontal();
            // EditorGUILayout.PropertyField(remainInState);
            EditorGUILayout.PropertyField(TransitionCoolDown);
            EditorGUILayout.PropertyField(RemoveAIOnDeath);



            EditorGUILayout.EndVertical();
        }
Exemplo n.º 15
0
        private void DrawGeneral()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            //EditorGUILayout.PropertyField(StrafeOnTarget, new GUIContent("Strafe on Target/Aim", "If is The Rider is aiming or has a Target:\nThe Character will be set to Strafe"));
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(StoreAfter);
            MalbersEditor.DrawDebugIcon(debug);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndVertical();

            EquipWeaponPoints();

            EditorGUILayout.PropertyField(UseWeaponsOnlyWhileRiding, new GUIContent("Weapons while Riding",
                                                                                    "The Weapons can only be used when the Rider is Mounting the Animal. (Disable this to test the weapons on ground (EXPERIMENTAL)"));
        }
Exemplo n.º 16
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Use a Mode on the Animal Controller to create combo sequences  \nActivate the combos using Activate(int) or Activate_XXYY(int) XX(Branch) YY(Combo Index)");

            EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(Branch, new GUIContent("Branch", "Current Branch ID for the Combo Sequence, if this value change then the combo will play different sequences"));

                MalbersEditor.DrawDebugIcon(debug);
                //  debug.boolValue = GUILayout.Toggle(debug.boolValue,new GUIContent("D","Debug"), EditorStyles.miniButton, GUILayout.Width(23));
            }
            EditorGUILayout.EndHorizontal();


            CombosReor.DoLayoutList();

            CombosReor.index = selectedCombo.intValue;
            int IndexCombo = CombosReor.index;

            if (IndexCombo != -1)
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    var combo = combos.GetArrayElementAtIndex(IndexCombo);

                    if (combo != null)
                    {
                        var name = combo.FindPropertyRelative("Name");
                        EditorGUILayout.LabelField(name.stringValue, EditorStyles.boldLabel);
                        var active             = combo.FindPropertyRelative("m_Active");
                        var OnComboFinished    = combo.FindPropertyRelative("OnComboFinished");
                        var OnComboInterrupted = combo.FindPropertyRelative("OnComboInterrupted");
                        EditorGUILayout.PropertyField(active, new GUIContent("Active", "is the Combo Active?"));
                        EditorGUILayout.HelpBox("Green Sequences are starters combos", MessageType.None);
                        EditorGUILayout.LabelField("Combo Sequence List", EditorStyles.boldLabel);
                        var sequence = combo.FindPropertyRelative("Sequence");
                        DrawSequence(IndexCombo, combo, sequence);
                        EditorGUILayout.PropertyField(OnComboFinished);
                        EditorGUILayout.PropertyField(OnComboInterrupted);
                    }
                }
                EditorGUILayout.EndVertical();
            }

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 17
0
        public virtual void PaintInspectorGUI(string title)
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription(title);


            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    //EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("value"), new GUIContent("Value", "The current value"));
                    //var useEvent = serializedObject.FindProperty("UseEvent");
                    //useEvent.boolValue = GUILayout.Toggle(useEvent.boolValue, new GUIContent("E", "Enable 'OnValueChanged' Event. It will be invoked only when the value changes"), EditorStyles.miniButton, GUILayout.Width(18));
                    //EditorGUILayout.EndHorizontal();
                    // MalbersEditor.DrawSplitter();

                    // EditorGUILayout.EndVertical();

                    //  EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("Description"));
                    //  EditorGUILayout.EndVertical();

                    // EditorGUILayout.BeginVertical(EditorStyles.helpBox);


                    //EditorGUILayout.PropertyField(useEvent, new GUIContent("Use Event", "If the value changes the On Value Changed Event will be invoked"));

                    //EditorGUI.BeginDisabledGroup(!useEvent.boolValue);

                    //if (useEvent.boolValue)
                    //{
                    //    MalbersEditor.DrawSplitter();
                    //    EditorGUILayout.PropertyField(serializedObject.FindProperty("OnValueChanged"));
                    //}
                    // EditorGUILayout.EndVertical();
                    // EditorGUI.EndDisabledGroup();
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 18
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();


            if (Application.isPlaying)
            {
                MalbersEditor.DrawHeader(M.name + " - List");
                EditorGUI.BeginDisabledGroup(true);

                for (int i = 0; i < M.Items.Count; i++)
                {
                    EditorGUILayout.ObjectField("Item " + i, M.Items[i], typeof(GameObject), false);
                }

                EditorGUI.EndDisabledGroup();
            }
        }
Exemplo n.º 19
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Receive Animations Events from the Animations Clips to play Sounds using the function (PlaySound (string Name))");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    list.DoLayoutList();

                    if (list.index != -1)
                    {
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            SerializedProperty Element = m_EventSound.GetArrayElementAtIndex(list.index);
                            EditorGUILayout.LabelField("►" + M.m_EventSound[list.index].name + "◄", EditorStyles.boldLabel);
                            EditorGUI.indentLevel++;
                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("Clips"), new GUIContent("Clips", "AudioClips"), true);
                            EditorGUI.indentLevel--;
                        }
                        EditorGUILayout.EndVertical();
                    }

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("_audioSource"), new GUIContent("Audio", "AudioSource"), true);
                        if (M._audioSource == null)
                        {
                            EditorGUILayout.HelpBox("If Audio is empty, this script will create an audiosource at runtime", MessageType.Info);
                        }
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Animation Event Sound");
                //  EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 20
0
 private void Draw_Bool(SerializedProperty Element)
 {
     if (useBool.boolValue)
     {
         MalbersEditor.DrawLineHelpBox();
         var useAdvBool = Element.FindPropertyRelative("AdvancedBool");
         // if (!useAdvBool.boolValue)
         {
             EditorGUILayout.PropertyField(Element.FindPropertyRelative("InvertBool"));
             EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseBool"), new GUIContent("Response"));
         }
         useAdvBool.boolValue = EditorGUILayout.ToggleLeft(new GUIContent("Use Advanced Bool", "Uses Separated Unity Events for True and False Entries"), useAdvBool.boolValue);
         if (useAdvBool.boolValue)
         {
             EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseBoolTrue"), new GUIContent("On True"));
             EditorGUILayout.PropertyField(Element.FindPropertyRelative("ResponseBoolFalse"), new GUIContent("On False"));
         }
     }
 }
Exemplo n.º 21
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Receive Animations Events from the Animations Clips to play Sounds using the function (PlaySound (string Name))");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MTools.StyleGray);
                {
                    list.DoLayoutList();

                    if (list.index != -1)
                    {
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            SerializedProperty Element = m_EventSound.GetArrayElementAtIndex(list.index);
                            EditorGUILayout.LabelField("[" + M.m_EventSound[list.index].name + "]", EditorStyles.boldLabel);
                            EditorGUI.indentLevel++;
                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("interval"));
                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("Clips"), new GUIContent("Clips", "AudioClips"), true);
                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("source"), new GUIContent("Internal Source", "AudioSource"));
                            EditorGUI.indentLevel--;
                        }
                        EditorGUILayout.EndVertical();
                    }

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    {
                        EditorGUILayout.PropertyField(serializedObject.FindProperty("_audioSource"), new GUIContent("Global Source", "AudioSource"), true);
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Animation Event Sound");
                //  EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            MalbersEditor.DrawDescription("Reset Scriptable Variables");

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

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetOnEnable"), new GUIContent("Reset on Enable", "Reset the values when this Script is Enabled"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetOnDisable"), new GUIContent("Reset on Disable", "Reset the values when this Script is Disabled, and when the Play button is Off (in the Editor)"));
                    Reo_ScriptVars.DoLayoutList();
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 23
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Plays the sound matching the physic material on the hit object\nInvoke the method 'PlayMaterialSound'");

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

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("audioSource"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("DefaultSound"));
                    EditorGUILayout.EndVertical();

                    list.DoLayoutList();

                    if (list.index != -1)
                    {
                        EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                        {
                            SerializedProperty Element      = soundbymaterial.GetArrayElementAtIndex(list.index);
                            SerializedProperty SoundElement = Element.FindPropertyRelative("Sounds");

                            MalbersEditor.Arrays(SoundElement);
                        }
                        EditorGUILayout.EndVertical();
                    }
                }

                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "SoundByMat Inspector");
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 24
0
        //private MStrafe M;

        // SerializedProperty updateAnimator, m_StrafeAngle, Target, MainCamera, SType, Normalize;

        //private void OnEnable()
        //{
        //    M = ((MStrafe)target);
        //    updateAnimator = serializedObject.FindProperty("UpdateAnimator");
        //    Normalize = serializedObject.FindProperty("Normalize");
        //    SType = serializedObject.FindProperty("SType");
        //    MainCamera = serializedObject.FindProperty("mainCamera");
        //    Target = serializedObject.FindProperty("target");
        //    m_StrafeAngle = serializedObject.FindProperty("m_StrafeAngle");
        //}


        public override void OnInspectorGUI()
        {
            MalbersEditor.DrawDescription("Strafing (Obsolete) Now its inside the Animal Controller");
            //serializedObject.Update();

            //MalbersEditor.DrawDescription("Strafing Logic");

            //EditorGUI.BeginChangeCheck();

            //EditorGUILayout.BeginVertical(MTools.StyleGray);


            //EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            //EditorGUILayout.PropertyField(SType, new GUIContent("Use", "Use Camera or a Target to Calculate the Strafing"));
            //EditorGUILayout.PropertyField(MainCamera, new GUIContent("Main Camera", "Use the Main Camera for the Strafe Logic"));
            //EditorGUILayout.PropertyField(Target, new GUIContent("Target", "Use a Target for the Strafe Logic"));
            //EditorGUILayout.EndVertical();


            //EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            //EditorGUILayout.PropertyField(updateAnimator, new GUIContent("Update Animator", "Update Animator with the Parameter"));

            //if (M.UpdateAnimator.Value)
            //{
            //    EditorGUILayout.PropertyField(Normalize, new GUIContent("Normalize", "Normalize the Angle Value. Instead of -180 to 180 it will go from -1 to 1"));
            //    EditorGUILayout.PropertyField(m_StrafeAngle, new GUIContent("Param Name", "Name of the Parameter on The Animator for the Strafing"));
            //}
            //EditorGUILayout.EndVertical();


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

            //serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 25
0
        private void ShowAbilities()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(CloneAbilities, new GUIContent("Clone Abilities", "If you are using more than one rider, enable this option"));
                MalbersEditor.Arrays(CombatAbilities, new GUIContent("Rider Combat Abilities", ""));
            }
            EditorGUILayout.EndVertical();


            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUI.indentLevel++;
                M.Editor_ShowAbilities = EditorGUILayout.Foldout(M.Editor_ShowAbilities, "Abilities Properties");
                EditorGUI.indentLevel--;

                if (M.Editor_ShowAbilities)
                {
                    if (M.CombatAbilities != null)
                    {
                        foreach (var combatAbility in M.CombatAbilities)
                        {
                            if (combatAbility != null)
                            {
                                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                EditorGUILayout.LabelField(combatAbility.name, EditorStyles.toolbarButton);
                                //EditorGUILayout.Separator();
                                DrawAbility(combatAbility);
                                EditorGUILayout.EndVertical();
                            }
                        }
                    }
                }
            }
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 26
0
        private void ShowCustom()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.PropertyField(straightSpine, new GUIContent("Straight Spine", "Straighten the Mount Point to fix the Rider Animation"));

                if (M.StraightSpine)
                {
                    EditorGUILayout.PropertyField(StraightSpineOffsetTransform, new GUIContent("Transf Ref", "Transform to use for the Point Offset Calculation"));
                    EditorGUILayout.PropertyField(pointOffset, new GUIContent("Point Offset", "Point in front of the Mount to Straight the Spine of the Rider"));
                    EditorGUILayout.PropertyField(smoothSM, new GUIContent("Smoothness", "Smooth changes between the rotation and the straight Mount"));
                }
            }
            EditorGUILayout.EndVertical();


            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            {
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.PropertyField(UseSpeedModifiers, new GUIContent("Animator Speeds", "Use this for other animals but the horse"));
                    helpUseSpeeds = GUILayout.Toggle(helpUseSpeeds, "?", EditorStyles.miniButton, GUILayout.Width(18));
                }
                EditorGUILayout.EndHorizontal();

                if (M.UseSpeedModifiers)
                {
                    if (helpUseSpeeds)
                    {
                        EditorGUILayout.HelpBox("Changes the Speed on the Rider's Animator to Sync with the Animal Animator.\nThe Original Riding Animations are meant for the Horse. Only change the Speeds for other creatures", MessageType.None);
                    }
                    MalbersEditor.Arrays(SpeedMultipliers, new GUIContent("Animator Speed Multipliers", "Velocity changes for diferent Animation Speeds... used on other animals"));
                }
            }
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 27
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Toggle || Swap Meshes");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    MalbersEditor.DrawScript(script);
                    {
                        list.DoLayoutList();
                        if (showMeshesList.boolValue)
                        {
                            if (list.index != -1)
                            {
                                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                {
                                    SerializedProperty Element = activeMeshesList.GetArrayElementAtIndex(list.index);
                                    MalbersEditor.Arrays(Element);
                                }
                                EditorGUILayout.EndVertical();
                            }
                        }
                    }
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Active Meshes Inspector");
                //EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 28
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Melee Weapons Properties");

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                CommonWeaponProperties();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUILayout.PropertyField(meleeCollider, new GUIContent("Melee Collider", "Gets the reference of where is the Melee Collider of this weapon (Not Always is in the same gameobject level)"));
                EditorGUILayout.EndVertical();

                SoundsList();

                EventList();

                CheckWeaponID();
            }
            EditorGUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 29
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Swap Materials");

            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
                {
                    list.DoLayoutList();
                    EditorGUI.indentLevel++;

                    if (showMeshesList.boolValue)
                    {
                        if (list.index != -1)
                        {
                            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                            {
                                SerializedProperty Element = materialList.GetArrayElementAtIndex(list.index);
                                //if (Element.objectReferenceValue != null)
                                {
                                    EditorGUILayout.LabelField(Element.FindPropertyRelative("Name").stringValue, EditorStyles.boldLabel);

                                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                    {
                                        EditorGUILayout.PropertyField(Element.FindPropertyRelative("mesh"), new GUIContent("Mesh", "Mesh object to apply the Materials"));
                                        EditorGUILayout.PropertyField(Element.FindPropertyRelative("indexM"), new GUIContent("ID", "Material ID"));
                                    }
                                    EditorGUILayout.EndVertical();

                                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                    {
                                        EditorGUILayout.PropertyField(Element.FindPropertyRelative("materials"), new GUIContent("Materials"), true);
                                    }
                                    EditorGUILayout.EndVertical();

                                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                                    {
                                        SerializedProperty hasLODS = Element.FindPropertyRelative("HasLODs");
                                        EditorGUILayout.PropertyField(hasLODS, new GUIContent("LODs", "Has Level of Detail Meshes"));
                                        if (hasLODS.boolValue)
                                        {
                                            EditorGUILayout.PropertyField(Element.FindPropertyRelative("LODs"), new GUIContent("Meshes", "Has Level of Detail Meshes"), true);
                                        }
                                    }
                                    EditorGUILayout.EndVertical();

                                    EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
                                    {
                                        EditorGUIUtility.labelWidth = 65;
                                        var linked = Element.FindPropertyRelative("Linked");

                                        EditorGUILayout.PropertyField(linked, new GUIContent("Linked", "This Material Item will be driven by another Material Item"));
                                        if (linked.boolValue)
                                        {
                                            var Master = Element.FindPropertyRelative("Master");
                                            EditorGUILayout.PropertyField(Master, new GUIContent("Master", "Which MaterialItem Index is the Master"));

                                            if (Master.intValue >= materialList.arraySize)
                                            {
                                                Master.intValue = materialList.arraySize - 1;
                                            }
                                        }
                                        EditorGUIUtility.labelWidth = 0;
                                    }
                                    EditorGUILayout.EndHorizontal();

                                    EditorGUILayout.BeginVertical();
                                    {
                                        EditorGUILayout.PropertyField(Element.FindPropertyRelative("OnMaterialChanged"), new GUIContent("On Material Changed", "Invoked when a material item index changes"));
                                    }
                                    EditorGUILayout.EndVertical();
                                }
                            }
                            EditorGUILayout.EndVertical();
                        }
                    }
                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Material Changer");
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 30
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Basic AI system for Animal Script");

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);

            MalbersEditor.DrawScript(script);

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("target"), new GUIContent("Target", "Target to follow"));

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(stoppingDistance, new GUIContent("Stopping Distance", "Agent Stopping Distance"));
            EditorGUILayout.PropertyField(walkDistance, new GUIContent("Walk Distance", "Distance to stop Runing and Start Walking"));

            if (EditorGUI.EndChangeCheck())
            {
                if (M.Agent)
                {
                    M.Agent.stoppingDistance = stoppingDistance.floatValue;
                    serializedObject.ApplyModifiedProperties();
                }
            }

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUI.indentLevel++;
            M.showevents = EditorGUILayout.Foldout(M.showevents, "Events");
            EditorGUI.indentLevel--;



            if (M.showevents)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("OnTargetPositionArrived"), new GUIContent("On Position Arrived"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("OnTargetArrived"), new GUIContent("On Target Arrived"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("OnActionStart"), new GUIContent("On Action Start"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("OnActionEnd"), new GUIContent("On Action End"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("OnDebug"), new GUIContent("On Debug"));
            }
            EditorGUILayout.EndVertical();


            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            var d = serializedObject.FindProperty("debug");

            EditorGUILayout.PropertyField(d);

            if (d.boolValue && Application.isPlaying)
            {
                EditorGUI.BeginDisabledGroup(true);
                EditorGUILayout.ObjectField("Next Target", M.NextTarget, typeof(Transform), false);
                EditorGUILayout.ObjectField("Next Target Zone?", M.IsZone, typeof(Zone), false);
                EditorGUILayout.ObjectField("Next Target WayPoint", M.IsWayPoint, typeof(MWayPoint), false);
                EditorGUILayout.Space();
                EditorGUILayout.FloatField("Remaining Distance", M.RemainingDistance);
                EditorGUILayout.Vector3Field("Target Position", M.TargetPosition);
                EditorGUILayout.ToggleLeft("Target is Moving?", M.TargetisMoving);
                EditorGUILayout.Space();
                EditorGUILayout.ToggleLeft("Is On Mode", M.IsOnMode);
                EditorGUILayout.ToggleLeft("Enter OffMesh", M.EnterOFFMESH);
                EditorGUILayout.ToggleLeft("Free Move", M.FreeMove);
                EditorGUILayout.ToggleLeft("Flying OffMesh", M.IsFlyingOffMesh);
                EditorGUILayout.ToggleLeft("Agent Active?", M.Agent.enabled);
                EditorGUILayout.ToggleLeft("Agent in NavMesh", M.Agent.isOnNavMesh);
                EditorGUILayout.ToggleLeft("Is Waiting?", M.IsWaiting);
                EditorGUILayout.ToggleLeft("Is Grounded?", M.IsGrounded);
                EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.EndVertical();

            if (!M.Agent)
            {
                EditorGUILayout.HelpBox("There's no Agent found on the hierarchy on this gameobject\nPlease add a NavMesh Agent Component", MessageType.Error);
            }


            EditorGUILayout.EndVertical();

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(target, "Animal AI Control Changed");
                //EditorUtility.SetDirty(target);
            }
            serializedObject.ApplyModifiedProperties();
        }