Exemplo n.º 1
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.BoolField("Teleport Self", "Determines if we're teleporting ourselves or a target.", TeleportSelf, rTarget))
            {
                lIsDirty     = true;
                TeleportSelf = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.BoolField("Teleport Camera", "Determines if we're teleporting the camera too (if it is set on the MC).", TeleportCamera, rTarget))
            {
                lIsDirty       = true;
                TeleportCamera = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.Vector3Field("Position", "Fixed position to teleport to. Use (0, 0, 0) to not use a fixed position.", Position, rTarget))
            {
                lIsDirty = true;
                Position = EditorHelper.FieldVector3Value;
            }

            return(lIsDirty);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            // Damage
            UnityEngine.GUILayout.BeginHorizontal();

            UnityEditor.EditorGUILayout.LabelField(new UnityEngine.GUIContent("Time", "Min and Max time to wait. When Max is > 0, a random time will be chosen between the Min and Max."), UnityEngine.GUILayout.Width(UnityEditor.EditorGUIUtility.labelWidth));

            if (EditorHelper.FloatField(Time, "Min Time", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                Time     = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.FloatField(MaxTime, "Max Time", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                MaxTime  = EditorHelper.FieldFloatValue;
            }

            UnityEngine.GUILayout.EndHorizontal();

            return(lIsDirty);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Effect Name", "Unique name to give the actor effect.", EffectName, rTarget))
            {
                lIsDirty   = true;
                EffectName = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.Vector3Field("Movement", "Movement that is the direction and speed (per second) that the character should move.", Movement, rTarget))
            {
                lIsDirty = true;
                Movement = EditorHelper.FieldVector3Value;
            }

            if (EditorHelper.FloatField("Max Age", "Time (in seconds) that the movement should continue for.", MaxAge, rTarget))
            {
                lIsDirty = true;
                MaxAge   = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.BoolField("Reduce Over Time", "Determines if we reduce movement over time", ReduceMovementOverTime, rTarget))
            {
                lIsDirty = true;
                ReduceMovementOverTime = EditorHelper.FieldBoolValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Effect Name", "Unique name to give the actor effect.", EffectName, rTarget))
            {
                lIsDirty   = true;
                EffectName = EditorHelper.FieldStringValue;
            }

            NodeEditorStyle.DrawInspectorDescription("The prefab must include a Particle Core component.", MessageType.None);

            if (EditorHelper.ObjectField <GameObject>("Prefab", "Prefab we'll use as a template to spawn GameObjects.", Prefab, rTarget))
            {
                lIsDirty = true;
                Prefab   = EditorHelper.FieldObjectValue as GameObject;
            }

            GUILayout.Space(5f);

            if (EditorHelper.FloatField("Max Age", "Time before the effect expires.", MaxAge, rTarget))
            {
                lIsDirty = true;
                MaxAge   = EditorHelper.FieldFloatValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll do the test on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Component Class", "Full class name of the component. For example: ''", ComponentClass, rTarget))
            {
                lIsDirty       = true;
                ComponentClass = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.TextField("Property Name", "Name of the property to set", PropertyName, rTarget))
            {
                lIsDirty     = true;
                PropertyName = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.TextField("String", "String representation of the value.", StringArgument, rTarget))
            {
                lIsDirty       = true;
                StringArgument = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Renders the currently selected step
        /// </summary>
        /// <param name="rStep"></param>
        private bool DrawActionDetailItem(NodeLinkAction rItem)
        {
            bool lIsDirty = false;

            if (rItem == null)
            {
                EditorGUILayout.LabelField("NULL");
                return(false);
            }

            string lDescription = BaseDescriptionAttribute.GetDescription(rItem.GetType());

            if (lDescription.Length > 0)
            {
                NodeEditorStyle.DrawInspectorDescription(lDescription, MessageType.None);
            }

            // Render out the action specific inspectors
            bool lIsActionDirty = rItem.OnInspectorGUI(mTarget);

            if (lIsActionDirty)
            {
                lIsDirty = true;
            }

            if (lIsDirty)
            {
                EditorUtility.SetDirty(rItem);
            }

            return(lIsDirty);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll do the test on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Attribute Name", "Name of the property to set", AttributeName, rTarget))
            {
                lIsDirty      = true;
                AttributeName = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.TextField("Value", "String representation of the value to set.", StringValue, rTarget))
            {
                lIsDirty    = true;
                StringValue = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll do the test on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Target Name", "Name of the GameObject to be enabled or disabled. This overrides any targets that were set by other actions.", TargetName, rTarget))
            {
                lIsDirty   = true;
                TargetName = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.BoolField("Enable Target", "Determines if we are enabling or disabling the target", EnableTarget, rTarget))
            {
                lIsDirty     = true;
                EnableTarget = EditorHelper.FieldBoolValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            if (TargetTypeIndex == 0 || TargetTypeIndex == 1)
            {
                NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

                if (EditorHelper.PopUpField("Deactivation", "", CompletionIndex, CompletionList, rTarget))
                {
                    lIsDirty        = true;
                    CompletionIndex = EditorHelper.FieldIntValue;
                }

                if (CompletionIndex == 3)
                {
                    if (EditorHelper.FloatField("Exit Time", "Elapsed time (in seconds) that the motion has run for.", ExitTime, rTarget))
                    {
                        lIsDirty = true;
                        ExitTime = EditorHelper.FieldFloatValue;
                    }
                }
                else if (CompletionIndex == 4)
                {
                    if (EditorHelper.TextField("Exit State", "Full path to the state we'll exit on.", ExitState, rTarget))
                    {
                        lIsDirty  = true;
                        ExitState = EditorHelper.FieldStringValue;
                    }

                    if (EditorHelper.FloatField("Exit Time", "Normalized time (0 to 1) of the state specified.", ExitTime, rTarget))
                    {
                        lIsDirty = true;
                        ExitTime = Mathf.Clamp01(EditorHelper.FieldFloatValue);
                    }
                }
            }

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll activate the motions on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Motion", "Name of the motion to activate.", MotionName, rTarget))
            {
                lIsDirty   = true;
                MotionName = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            // Impact Power
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("Impulse Power", "Min and max force to apply."), GUILayout.Width(EditorGUIUtility.labelWidth - 4f));

            if (EditorHelper.FloatField(MinPower, "Min Power", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                MinPower = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.FloatField(MaxPower, "Max Power", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                MaxPower = EditorHelper.FieldFloatValue;
            }

            GUILayout.EndHorizontal();

            if (EditorHelper.BoolField("Invert", "Determines if we invert the power to create a pull instead of a push.", Invert, rTarget))
            {
                lIsDirty = true;
                Invert   = EditorHelper.FieldBoolValue;
            }

            GUILayout.Space(5f);

            // Add Force
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("Add AC Force", "Determines if we move the actor by adding an impulse to the Actor Controller directly."), GUILayout.Width(EditorGUIUtility.labelWidth - 4f));

            if (EditorHelper.BoolField(AddForce, "Add Force", rTarget, 16f))
            {
                lIsDirty = true;
                AddForce = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.FloatField(AddForceFactor, "Force Factor", rTarget, 0f, 20f))
            {
                lIsDirty       = true;
                AddForceFactor = EditorHelper.FieldFloatValue;
            }

            GUILayout.EndHorizontal();

            return(lIsDirty);
        }
Exemplo n.º 11
0
    public NodeBase CreateNode(string name, Type nodeType, Vector2 xyCount, GUIStyle nodeNormalStyle, GUIStyle nodeSelectedStyle)
    {
        Vector2         pos         = _window.GetPosition(xyCount);
        Rect            rect        = new Rect(pos.x, pos.y, 200, 50);
        NodeEditorStyle editorStyle = new NodeEditorStyle(rect, xyCount, name, nodeNormalStyle, nodeSelectedStyle);
        var             node        = ScriptableObject.CreateInstance(nodeType) as NodeBase;

        node.InitEditorNode(editorStyle);
        _nodeList.Add(node);
        _window.Repaint();
        return(node);
    }
Exemplo n.º 12
0
    public void InitEditorNode(NodeEditorStyle style)
    {
        this.Style = style;
        Rect statusRect = new Rect(Style.Rect.position.x + Style.Rect.width - (Style.Rect.height / 2.5f * 2), Style.Rect.position.y + Style.Rect.height / 2.5f * 0.5f, Style.Rect.height / 2.5f, Style.Rect.height / 2.5f);

        m_Status         = new NodeStatusStyles(statusRect);
        _curStyle        = Style.NormalStyle;
        _curStatus       = m_Status.NotWork;
        _descriptionRect = new Rect(Style.Rect.position + new Vector2(-Style.Rect.width * 0.5f, Style.Rect.height), new Vector2(Style.Rect.width * 2, Style.Rect.height * 0.7f));
        //_initialNodeSize = Style.Rect.size;
        //资产资源名
        name = Name;
    }
Exemplo n.º 13
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll do the test on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Attribute Name", "Name of the attribute whose value we will compare", AttributeName, rTarget))
            {
                lIsDirty      = true;
                AttributeName = EditorHelper.FieldStringValue;
            }

            // Random
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("+ Random", "Min and max random value to add to the attribute value before testin."), GUILayout.Width(EditorGUIUtility.labelWidth - 4f));

            if (EditorHelper.FloatField(MinRandom, "Min Damage", rTarget, 0f, 20f))
            {
                lIsDirty  = true;
                MinRandom = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.FloatField(MaxRandom, "Max Damage", rTarget, 0f, 20f))
            {
                lIsDirty  = true;
                MaxRandom = EditorHelper.FieldFloatValue;
            }

            GUILayout.EndHorizontal();

            if (EditorHelper.PopUpField("Comparison", "Comparison to make.", ComparisonIndex, Comparisons, rTarget))
            {
                lIsDirty        = true;
                ComparisonIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.FloatField("Value", "Value we'll compare the 'attribute + random' value to.", Value, rTarget))
            {
                lIsDirty = true;
                Value    = EditorHelper.FieldFloatValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.IntField("Message ID", "Message ID to be sent to the Motion Controller.", MessageID, rTarget))
            {
                lIsDirty  = true;
                MessageID = EditorHelper.FieldIntValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Effect Name", "Name of the actor effect to deactivate.", EffectName, rTarget))
            {
                lIsDirty   = true;
                EffectName = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.Vector3Field("Start Offset", "Offset from the owner to start the raycasting.", StartOffset, rTarget))
            {
                lIsDirty    = true;
                StartOffset = EditorHelper.FieldVector3Value;
            }

            // Distance
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("Distance", "Min and max Distance for the projectile to succeed."), GUILayout.Width(EditorGUIUtility.labelWidth - 4f));

            if (EditorHelper.FloatField(MinDistance, "Min Distance", rTarget, 0f, 20f))
            {
                lIsDirty    = true;
                MinDistance = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.FloatField(MaxDistance, "Max Distance", rTarget, 0f, 20f))
            {
                lIsDirty    = true;
                MaxDistance = EditorHelper.FieldFloatValue;
            }

            GUILayout.EndHorizontal();

            GUILayout.Space(5f);

            int lNewGroundingLayers = EditorHelper.LayerMaskField(new GUIContent("Layers", "Layers that we'll test collisions against."), CollisionLayers);

            if (lNewGroundingLayers != CollisionLayers)
            {
                lIsDirty        = true;
                CollisionLayers = lNewGroundingLayers;
            }

            if (EditorHelper.TextField("Tags", "Comma delimited list of tags where at least one must exist for the selection to be valid.", Tags, rTarget))
            {
                lIsDirty = true;
                Tags     = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.BoolField("Succeed", "Determines if the result is success or failure.", Succeed, rTarget))
            {
                lIsDirty = true;
                Succeed  = EditorHelper.FieldBoolValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Text", "Text to write.", Text, rTarget))
            {
                lIsDirty = true;
                Text     = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.BoolField("Set Owner", "Determines if we set the owner as a previous target.", SetOwnerAsPreviousTarget, rTarget))
            {
                lIsDirty = true;
                SetOwnerAsPreviousTarget = EditorHelper.FieldBoolValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = true;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Action Alias", "Input entry that we're waiting for.", ActionAlias, rTarget))
            {
                lIsDirty    = true;
                ActionAlias = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowPrefabField       = false;
            mEditorShowDeactivationField = true;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.ObjectField <AudioClip>("Audio Clip", "", AudioClip, rTarget))
            {
                lIsDirty  = true;
                AudioClip = EditorHelper.FieldObjectValue as AudioClip;
            }

            return(lIsDirty);
        }
Exemplo n.º 22
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.BoolField("Shift Targets", "Determines if we shift the current targets to the 'previous targets' list first.", ShiftToPreviousTargets, rTarget))
            {
                lIsDirty = true;
                ShiftToPreviousTargets = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.BoolField("Replace Targets", "Determines if we clear existing targets before attempting to add the owner.", Replace, rTarget))
            {
                lIsDirty = true;
                Replace  = EditorHelper.FieldBoolValue;
            }

            GUILayout.Space(5f);

            if (EditorHelper.TextField("Tags", "Comma delimited list of tags where at least one must exist for the owner to be valid.", Tags, rTarget))
            {
                lIsDirty = true;
                Tags     = EditorHelper.FieldStringValue;
            }

            if (EditorHelper.BoolField("Rigidbody Required", "Determines if the owner must have a Rigidbody component.", RequireRigidbody, rTarget))
            {
                lIsDirty         = true;
                RequireRigidbody = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.BoolField("ActorCore Required", "Determines if the owner must have an ActorCore component.", RequireActorCore, rTarget))
            {
                lIsDirty         = true;
                RequireActorCore = EditorHelper.FieldBoolValue;
            }

            if (EditorHelper.BoolField("Combatant Required", "Determines if the owner must have a Combatant component.", RequireCombatant, rTarget))
            {
                lIsDirty         = true;
                RequireCombatant = EditorHelper.FieldBoolValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll modify.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.ObjectField <Material>("Material", "Material to add to the target", Material, rTarget))
            {
                lIsDirty = true;
                Material = EditorHelper.FieldObjectValue as Material;
            }

            return(lIsDirty);
        }
Exemplo n.º 24
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll do the test on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Attribute Name", "Name of the attribute whose value we will compare", AttributeName, rTarget))
            {
                lIsDirty = true;
                AttributeName = EditorHelper.FieldStringValue;
            }

            return lIsDirty;
        }
Exemplo n.º 25
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Owner Type", "Determines the type of GameObject that owns the particle.", OwnerTypeIndex, SpellAction.GetBestTargetTypes, rTarget))
            {
                lIsDirty       = true;
                OwnerTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Target Name", "Name of the ParticleCore object to be stopped.", TargetName, rTarget))
            {
                lIsDirty   = true;
                TargetName = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll modify.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.IntField("Material Index", "Index of the material to use. Use -1 to remove the last material.", Index, rTarget))
            {
                lIsDirty = true;
                Index    = EditorHelper.FieldIntValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 27
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.TextField("Effect Name", "Unique name to give the actor effect.", EffectName, rTarget))
            {
                lIsDirty   = true;
                EffectName = EditorHelper.FieldStringValue;
            }

            // Movement Factor
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField(new GUIContent("Value", "Min and max factor to change movement by."), GUILayout.Width(EditorGUIUtility.labelWidth - 4f));

            if (EditorHelper.FloatField(MinValue, "Min Value", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                MinValue = EditorHelper.FieldFloatValue;
            }

            if (EditorHelper.FloatField(MaxValue, "Max Value", rTarget, 0f, 20f))
            {
                lIsDirty = true;
                MaxValue = EditorHelper.FieldFloatValue;
            }

            GUILayout.EndHorizontal();

            GUILayout.Space(5f);

            if (EditorHelper.FloatField("Max Age", "Time before the effect expires.", MaxAge, rTarget))
            {
                lIsDirty = true;
                MaxAge   = EditorHelper.FieldFloatValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 28
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll activate the motions on.", TargetTypeIndex, DeactivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.TextField("Motion", "Name of the motion to activate.", MotionName, rTarget))
            {
                lIsDirty   = true;
                MotionName = EditorHelper.FieldStringValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            mEditorShowDeactivationField = false;
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Spell State", "State of the spell we were comparing to. If equal, the test passes.", SpellState, EnumSpellState.Names, rTarget))
            {
                lIsDirty   = true;
                SpellState = EditorHelper.FieldIntValue;
            }

            if (EditorHelper.FloatField("Expire Time", "Max amount of time we'll wait.", Time, rTarget))
            {
                lIsDirty = true;
                Time     = EditorHelper.FieldFloatValue;
            }

            return(lIsDirty);
        }
Exemplo n.º 30
0
        /// <summary>
        /// Called when the inspector needs to draw
        /// </summary>
        public override bool OnInspectorGUI(UnityEngine.Object rTarget)
        {
            bool lIsDirty = base.OnInspectorGUI(rTarget);

            NodeEditorStyle.DrawLine(NodeEditorStyle.LineBlue);

            if (EditorHelper.PopUpField("Target Type", "Determines the target(s) we'll activate the motions on.", TargetTypeIndex, ActivateMotion.GetBestTargetTypes, rTarget))
            {
                lIsDirty        = true;
                TargetTypeIndex = EditorHelper.FieldIntValue;
            }

            int lIndex = (_MessageID == 0 ? 0 : _MessageID - MotionMessage.MSG_UNKNOWN);

            if (EditorHelper.PopUpField("Message ID", "", lIndex, MotionMessage.Names, rTarget))
            {
                lIsDirty  = true;
                MessageID = EditorHelper.FieldIntValue + MotionMessage.MSG_UNKNOWN;
            }

            return(lIsDirty);
        }