예제 #1
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetGameObjectField.BuildFieldA("Turn on this game object:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();
        }
예제 #2
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetUnityObjectField.BuildFieldA <SceneAsset>("Load this scene:", actionParams, heroAction.actionFields[0], false);
            SimpleLayout.EndVertical();
        }
예제 #3
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 2);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Move a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();
        }
예제 #4
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 2);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetPrefabValue.BuildField("Template to use:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();
        }
예제 #5
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetObjectValue.BuildField <AudioMixerSnapshot>("Audio Mixer Snapshot:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();
        }
예제 #6
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 22);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Use the method on a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            // add class
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            MonoScript script = GetUnityObjectField.BuildFieldA <MonoScript>("The script on the hero object:", actionParams, heroAction.actionFields[2]);

            SimpleLayout.EndVertical();

            // add method
            if (script != null)
            {
                SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                SimpleLayout.Label("The method to call in the script:");
                MethodInfo method = GetMethodField.BuildFieldA(script, "", actionParams, heroAction.actionFields[3]);
                SimpleLayout.EndVertical();

                if (method != null)
                {
                    SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                    // add parameters (up to 15)
                    GetParameterField.BuildFieldA("Parameters to pass into the method:", actionParams, heroAction.actionFields[4], 5, 19, method, heroAction);
                    SimpleLayout.EndVertical();

                    SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                    // add return value (1)
                    GetParameterField.BuildFieldB("Return value to save on the hero object:", actionParams, heroAction.actionFields[20], heroAction.actionFields[21], method);
                    SimpleLayout.EndVertical();
                }
            }
        }
예제 #7
0
        /// <summary>
        /// Get a value from a hero object field. This is for a field that contains a hero kit object in a scene.
        /// </summary>
        /// <param name="title">Title for action field.</param>
        /// <param name="actionParams">Action field parameters.</param>
        /// <param name="actionField">Action field.</param>
        /// <param name="titleToLeft">Show the title on the left?</param>
        public static void BuildFieldD(string title, HeroActionParams actionParams, HeroActionField actionField, bool titleToLeft = false)
        {
            HeroObjectFieldData data = CreateFieldData(title, actionField, actionParams.heroObject);

            //-----------------------------------------
            // Display this title above the field
            //-----------------------------------------
            if (data.title != "" && !titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }
            SimpleLayout.BeginHorizontal();
            if (data.title != "" && titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }
            else
            {
                SimpleLayout.Space(8);
            }

            //-----------------------------------------
            // Get the type of object we are working with
            //-----------------------------------------
            SimpleLayout.Space(-8);
            data = ActionCommon.GetHeroObjectInScene(data);

            //-----------------------------------------
            // assign values back to hero object fields
            //-----------------------------------------
            actionField.heroObjects[0] = data.targetHeroObject;
            actionField.ints[0]        = data.objectType;
            actionField.ints[1]        = data.objectID;
            actionField.ints[2]        = data.fieldID;
            actionField.ints[3]        = data.fieldType;
            actionField.ints[4]        = data.heroGUID;
            actionField.ints[5]        = data.propertyID;
            actionField.strings[0]     = data.objectName;

            //-----------------------------------------
            // Visual stuff
            //-----------------------------------------
            SimpleLayout.Space();
            SimpleLayout.EndHorizontal();
        }
예제 #8
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            // Field: Skip (hidden, only for else if)
            GetConditionalField.BuildField(actionParams, heroAction.actionFields[0]);

            SimpleLayout.Label("There are no fields for this action.");
        }
예제 #9
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            // holds the id of the action that is the head of the loop
            ActionCommon.CreateLoopFieldData(heroAction.actionFields[0]);

            SimpleLayout.Label("There are no fields for this action.");
        }
예제 #10
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 1);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            // assign values in the hero kit object
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldC("Item to add:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();
        }
예제 #11
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 9);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Get game object on a different hero object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool useName = GetBoolValue.BuildField("Get child game object with a specific name?", actionParams, heroAction.actionFields[2], true);

            if (useName)
            {
                GetStringField.BuildFieldA("", actionParams, heroAction.actionFields[3], true);
            }

            bool useTag = GetBoolValue.BuildField("Get child game object with a specific tag?", actionParams, heroAction.actionFields[4], true);

            if (useTag)
            {
                GetTagField.BuildField("", actionParams, heroAction.actionFields[5], true);
            }

            bool useLayer = GetBoolValue.BuildField("Get child game object on a specific layer?", actionParams, heroAction.actionFields[6], true);

            if (useLayer)
            {
                GetDropDownField.BuildField("", actionParams, heroAction.actionFields[7], new LayerListField(), true);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetGameObjectField.BuildFieldB("Save the child game object here:", actionParams, heroAction.actionFields[8]);
            SimpleLayout.EndVertical();
        }
예제 #12
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 18);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetUnityObjectField.BuildFieldA <ParticleSystem>("The particle effect to play:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changePos = GetBoolValue.BuildField("Change position?", actionParams, heroAction.actionFields[1], true);

            if (changePos)
            {
                GetCoordinatesField.BuildField("", actionParams,
                                               heroAction.actionFields[2], heroAction.actionFields[3],
                                               heroAction.actionFields[4], heroAction.actionFields[5],
                                               heroAction.actionFields[6], heroAction.actionFields[7]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeRotation = GetBoolValue.BuildField("Change rotation?", actionParams, heroAction.actionFields[8], true);

            if (changeRotation)
            {
                GetCoordinatesField.BuildField("", actionParams,
                                               heroAction.actionFields[9], heroAction.actionFields[10],
                                               heroAction.actionFields[11], heroAction.actionFields[12],
                                               heroAction.actionFields[13], heroAction.actionFields[14]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Don't play next action until this action completes?", actionParams, heroAction.actionFields[15], true);
            SimpleLayout.EndVertical();
        }
예제 #13
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 8);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changePrefab = GetBoolValue.BuildField("Use a new prefab?", actionParams, heroAction.actionFields[2], true);

            if (changePrefab)
            {
                GetPrefabValue.BuildField("", actionParams, heroAction.actionFields[3]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeRigidbody = GetBoolValue.BuildField("Use a new rigidbody?", actionParams, heroAction.actionFields[4], true);

            if (changeRigidbody)
            {
                GetRigidbodyValue.BuildField("", actionParams, heroAction.actionFields[5]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeHidden = GetBoolValue.BuildField("Show or hide visuals?", actionParams, heroAction.actionFields[6], true);

            if (changeHidden)
            {
                string[] choices = { "Show Visuals", "Hide Visuals" };
                GetDropDownField.BuildField("", actionParams, heroAction.actionFields[7], new GenericListField(choices), true);
            }
            SimpleLayout.EndVertical();
        }
예제 #14
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 9);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Rotate a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] direction = { "Clockwise", "Counterclockwise" };
            bool     changeX   = GetBoolValue.BuildField("X Axis", actionParams, heroAction.actionFields[2], true);

            if (changeX)
            {
                GetDropDownField.BuildField("", actionParams, heroAction.actionFields[3], new GenericListField(direction));
            }
            bool changeY = GetBoolValue.BuildField("Y Axis", actionParams, heroAction.actionFields[4], true);

            if (changeY)
            {
                GetDropDownField.BuildField("", actionParams, heroAction.actionFields[5], new GenericListField(direction));
            }
            bool changeZ = GetBoolValue.BuildField("Z Axis", actionParams, heroAction.actionFields[6], true);

            if (changeZ)
            {
                GetDropDownField.BuildField("", actionParams, heroAction.actionFields[7], new GenericListField(direction));
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Speed:", actionParams, heroAction.actionFields[8]);
            SimpleLayout.EndVertical();
        }
예제 #15
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldA("Name of the setting:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            int valueType = GetDropDownField.BuildField("Type of value to load:", actionParams, heroAction.actionFields[0], new PlayerPrefTypeField());

            if (valueType != 0)
            {
                SimpleLayout.Label("Save the value here:");
            }

            if (valueType == 1)
            {
                GetIntegerField.BuildFieldB("", actionParams, heroAction.actionFields[1]);
            }
            else if (valueType == 2)
            {
                GetFloatField.BuildFieldB("", actionParams, heroAction.actionFields[1]);
            }
            else if (valueType == 3)
            {
                GetBoolField.BuildFieldB("", actionParams, heroAction.actionFields[1]);
            }
            else if (valueType == 4)
            {
                GetStringField.BuildFieldB("", actionParams, heroAction.actionFields[1]);
            }
            SimpleLayout.EndVertical();
        }
예제 #16
0
        /// <summary>
        /// Get a hero kit object or game object.
        /// </summary>
        /// <param name="title">Title for action field.</param>
        /// <param name="actionParams">Action field parameters.</param>
        /// <param name="actionFieldA">Action field.</param>
        /// <param name="actionFieldB">Action field.</param>
        public static void BuildField(string title, HeroActionParams actionParams, HeroActionField actionFieldA, HeroActionField actionFieldB)
        {
            SimpleLayout.Label("The type of object that contains the " + title + ":");

            string[] items  = { "Hero Object", "Game Object" };
            int      result = GetDropDownField.BuildField("", actionParams, actionFieldA, new GenericListField(items));

            if (result == 1)
            {
                SimpleLayout.Label("The hero object that contains the " + title + ":");
                GetHeroObjectField.BuildFieldA("", actionParams, actionFieldB);
            }

            else if (result == 2)
            {
                SimpleLayout.Label("The game object that contains the " + title + ":");
                GetGameObjectField.BuildFieldA("", actionParams, actionFieldB);
            }
        }
예제 #17
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            HeroObject targetHeroObject = GetHeroObjectField.BuildFieldE("Animate another hero object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);

            SimpleLayout.EndVertical();

            ActionCommon.GetAnimation("", actionParams, heroAction.actionFields[2], heroAction.actionFields[3], heroAction.actionFields[4], AnimatorControllerParameterType.Bool, targetHeroObject);
        }
예제 #18
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldB("Float A:", actionParams, heroAction.actionFields[0]);
            GetDropDownField.BuildField("Operator:", actionParams, heroAction.actionFields[1], new MathOperatorField());
            GetFloatField.BuildFieldA("Float B:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
예제 #19
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 6);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Image ID:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Speed:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] choices    = { "Rotate X number of degrees", "Rotate clockwise for X amount of time", "Rotate counterclockwise for X amount of time" };
            int      rotateType = GetDropDownField.BuildField("Type:", actionParams, heroAction.actionFields[2], new GenericListField(choices));

            // rotate x number of degrees
            if (rotateType == 1)
            {
                GetIntegerField.BuildFieldA("Degrees to Rotate:", actionParams, heroAction.actionFields[3]);
            }

            // rotate clockwise / counterclockwise
            else if (rotateType == 2 || rotateType == 3)
            {
                GetIntegerField.BuildFieldA("Length of time (seconds):", actionParams, heroAction.actionFields[4]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Don't play next action until this action completes?", actionParams, heroAction.actionFields[5], true);
            SimpleLayout.EndVertical();
        }
예제 #20
0
        /// <summary>
        /// Get a field from a script and set this value in a hero object list.
        /// </summary>
        /// <param name="field">The field to set.</param>
        /// <param name="actionParams">Action field parameters.</param>
        /// <param name="actionFieldB">Action field.</param>
        private static void SetFieldOnHero(FieldInfo field, HeroActionParams actionParams, HeroActionField actionFieldB)
        {
            // Get value on the target instance.
            object value = field.FieldType;

            // Test value type.
            if (value == typeof(int))
            {
                GetIntegerField.BuildFieldB(field.Name + " (Int): ", actionParams, actionFieldB);
            }
            else if (value == typeof(float))
            {
                GetFloatField.BuildFieldB(field.Name + " (Float): ", actionParams, actionFieldB);
            }
            else if (value == typeof(string))
            {
                GetStringField.BuildFieldB(field.Name + " (String): ", actionParams, actionFieldB);
            }
            else if (value == typeof(bool))
            {
                GetBoolField.BuildFieldB(field.Name + " (Bool): ", actionParams, actionFieldB);
            }
            else if (value == typeof(HeroKitObject))
            {
                GetHeroObjectField.BuildFieldB(field.Name + " (HeroObject): ", actionParams, actionFieldB);
            }
            else if (value == typeof(GameObject))
            {
                GetGameObjectField.BuildFieldB(field.Name + " (GameObject): ", actionParams, actionFieldB);
            }
            else
            {
                string valueType = value.ToString();
                int    index     = valueType.LastIndexOf('.');
                if (valueType.Length >= 2)
                {
                    valueType = valueType.Substring(index + 1, valueType.Length - index - 1);
                }

                SimpleLayout.Label(valueType + " " + field.Name + ": [Value can't be stored by HeroKit]");
            }
        }
예제 #21
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 10);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            HeroObject targetHeroObject = GetHeroObjectField.BuildFieldE("Move a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);

            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Movement Speed:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] items         = { "Object has animatior controller", "Object has animation component", "Don't animate this object" };
            int      animationType = GetDropDownField.BuildField("Animation system:", actionParams, heroAction.actionFields[3], new GenericListField(items));

            SimpleLayout.EndVertical();

            if (animationType != 3)
            {
                SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                if (animationType <= 1)
                {
                    ActionCommon.GetAnimation("Walk Animation:", actionParams, heroAction.actionFields[4], heroAction.actionFields[5], heroAction.actionFields[6], AnimatorControllerParameterType.Bool, targetHeroObject);
                }
                else
                {
                    ActionCommon.GetAnimation_Legacy("Walk Animation:", actionParams, heroAction.actionFields[4], heroAction.actionFields[5], heroAction.actionFields[6], targetHeroObject);
                    ActionCommon.GetAnimation_Legacy("Idle Animation:", actionParams, heroAction.actionFields[7], heroAction.actionFields[8], heroAction.actionFields[9], targetHeroObject);
                }
                SimpleLayout.EndVertical();
            }
        }
예제 #22
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 10);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change position of a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetChildObjectField.BuildField("Change position of a child object?", actionParams, heroAction.actionFields[2], heroAction.actionFields[3]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeX = GetBoolValue.BuildField("Change X Pos?", actionParams, heroAction.actionFields[4], true);

            if (changeX)
            {
                GetFloatField.BuildFieldA("", actionParams, heroAction.actionFields[5]);
            }
            bool changeY = GetBoolValue.BuildField("Change Y Pos?", actionParams, heroAction.actionFields[6], true);

            if (changeY)
            {
                GetFloatField.BuildFieldA("", actionParams, heroAction.actionFields[7]);
            }
            bool changeZ = GetBoolValue.BuildField("Change Z Pos?", actionParams, heroAction.actionFields[8], true);

            if (changeZ)
            {
                GetFloatField.BuildFieldA("", actionParams, heroAction.actionFields[9]);
            }
            SimpleLayout.EndVertical();
        }
예제 #23
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetDropDownField.BuildField("Turn physics on or off:", actionParams, heroAction.actionFields[2], new OnOffField());
            SimpleLayout.EndVertical();
        }
예제 #24
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetSceneObjectValue.BuildField("text", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetObjectValue.BuildField <Font>("The new font for the text:", actionParams, heroAction.actionFields[2], false);
            SimpleLayout.EndVertical();
        }
예제 #25
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 2);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldA("Name of the save game file:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldB("Save scene name here:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();
        }
예제 #26
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change move settings for a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldA("Duration of move in seconds:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
예제 #27
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 2);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldA("Title:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Open from Start Menu?", actionParams, heroAction.actionFields[1], true);
            SimpleLayout.EndVertical();
        }
예제 #28
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetSceneObjectValue.BuildField("name", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldA("Use this name:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
예제 #29
0
        // --------------------------------------------------------------
        // Action Fields
        // --------------------------------------------------------------

        /// <summary>
        /// Get an object.
        /// </summary>
        /// <typeparam name="T">The type of object.</typeparam>
        /// <param name="title">Title for action field.</param>
        /// <param name="actionParams">Action field parameters.</param>
        /// <param name="actionField">Action field.</param>
        /// <param name="titleToLeft">Show the title on the left?</param>
        /// <returns>The object.</returns>
        public static Rigidbody BuildField(string title, HeroActionParams actionParams, HeroActionField actionField, bool titleToLeft = false)
        {
            // create the fields
            GetRigidbodyValueData data = CreateFieldData(title, actionField, actionParams.heroObject);

            //-----------------------------------------
            // Display this title above the field
            //-----------------------------------------
            if (data.title != "" && !titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }
            SimpleLayout.BeginHorizontal();
            if (data.title != "" && titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }

            //-----------------------------------------
            // Get the object you want to work with
            //-----------------------------------------
            string[] rigidbodyOptions = { "Default Rigidbody", "Custom Rigidbody", "No Rigidbody", "Heavy Rigidbody" };
            data.rigidbodyType = new GenericListField(rigidbodyOptions).SetValues(data.rigidbodyType, 0);
            data.fieldValue    = GetRigidbody(data.rigidbodyType);

            //data.fieldValue = SimpleLayout.ObjectField(data.fieldValue as Rigidbody, HeroKitCommon.GetWidthForField(60));

            //-----------------------------------------
            // assign values back to hero object fields
            //-----------------------------------------
            actionField.component = data.fieldValue;
            actionField.ints[0]   = data.rigidbodyType;

            //-----------------------------------------
            // Visual stuff
            //-----------------------------------------
            SimpleLayout.Space();
            SimpleLayout.EndHorizontal();

            return(actionField.component as Rigidbody);
        }
예제 #30
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetSceneObjectValue.BuildField("canvas", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolField.BuildFieldA("Show or hide canvas? (Show=true, Hide=false)", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }