public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4); //----------------------------------------- // create the fields for this action //----------------------------------------- // Field: Skip (hidden, only for else if) GetConditionalField.BuildField(actionParams, heroAction.actionFields[0]); // Field: Integer A SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldB("Bool A:", actionParams, heroAction.actionFields[1]); SimpleLayout.EndVertical(); // Field: Operator SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetDropDownField.BuildField("Operator:", actionParams, heroAction.actionFields[2], new TrueFalseField()); SimpleLayout.EndVertical(); // Field: Integer B SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldA("Bool B:", actionParams, heroAction.actionFields[3]); SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { //-------------------------------------------------- // HOW TO MODIFY FOR YOUR OWN ACTION // 1. Change the name of the class from HeroActionTemplateField to the name of your hero action field (ex. GetRayField). // 2. In section A, replace the 4 with the number of action fields your form is going to need. (if you don't know, use a large number and then change it when your form is complete.) // 3. In section B, delete the sample form fields and add your own. //-------------------------------------------------- HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // SECTION A (create the action fields if they don't exist) //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4); //----------------------------------------- // SECTION B (create the fields for this action) //----------------------------------------- // Sample form field 1 (requires two action fields) SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetHeroObjectField.BuildFieldE("Work with a different hero object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]); SimpleLayout.EndVertical(); // Sample form field 2 (requires one action field) SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldB("Change this bool:", actionParams, heroAction.actionFields[2]); SimpleLayout.EndVertical(); // Sample form field 3 (requires one action field) SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldA("To this value:", actionParams, heroAction.actionFields[3]); SimpleLayout.EndVertical(); }
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); HeroObject targetHO = GetHeroObjectField.BuildFieldC("Get bool from this hero object template:", actionParams, heroAction.actionFields[0]); if (targetHO != null) { GetBoolField.BuildFieldC("The bool:", actionParams, heroAction.actionFields[1], targetHO); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldB("Save the bool here:", actionParams, heroAction.actionFields[2]); SimpleLayout.EndVertical(); }
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); GetBoolField.BuildFieldB("The bool to flip:", actionParams, heroAction.actionFields[0]); SimpleLayout.EndVertical(); }
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(); }
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(); }
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("toggle field", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldA("The new value for the toggle:", actionParams, heroAction.actionFields[2]); SimpleLayout.EndVertical(); }
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); GetGameObjectField.BuildFieldA("Game object:", actionParams, heroAction.actionFields[0]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldA("Turn game object on or off (On=True, Off=False):", actionParams, heroAction.actionFields[1]); SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 21); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetHeroObjectField.BuildFieldE("Attach the script as a component on a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); MonoScript script = GetUnityObjectField.BuildFieldA <MonoScript>("The script:", actionParams, heroAction.actionFields[2]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolField.BuildFieldA("Enable the component?", actionParams, heroAction.actionFields[3]); SimpleLayout.EndVertical(); // add method if (script != null) { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool result = GetBoolValue.BuildField("Update properties for this script component?", actionParams, heroAction.actionFields[4], true); if (result) { GetPropertyField.BuildFieldA("", actionParams, heroAction.actionFields[5], 6, 20, script, heroAction); } SimpleLayout.EndVertical(); } }
/// <summary> /// Bool conditions that must be satisfied for the event to run. /// </summary> private static void DrawBoolConditionFields() { SimpleLayout.BeginVertical(Box.StyleB); // ROW: START ----------------------------------------- SimpleLayout.BeginHorizontal(); // COLUMN 1: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Label("BOOLS (these conditions must be met before this event can run):"); SimpleLayout.EndVertical(); // COLUMN 1: END -------------------------------------- SimpleLayout.Space(); // COLUMN 2: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Button(Content.AddIcon, addBoolCondition, Button.StyleA, 25); SimpleLayout.EndVertical(); // COLUMN 2: END -------------------------------------- SimpleLayout.EndHorizontal(); // ROW: END ------------------------------------------- if (eventBlock.boolConditions.Count > 0) { SimpleLayout.Line(); } // List of entries for (int i = 0; i < eventBlock.boolConditions.Count; i++) { // ROW 1: START --------------------------------------- SimpleLayout.BeginHorizontal(); // COLUMN 1: START ------------------------------------ SimpleLayout.BeginVertical(); // VALUE 1 SimpleLayout.BeginHorizontal(); GetBoolField.BuildEventField("Value 1:", eventBlock.boolConditions[i].itemA, heroObject); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // OPERATOR SimpleLayout.BeginHorizontal(); SimpleLayout.Space(60); eventBlock.boolConditions[i].operatorID = new TrueFalseField().SetValues(eventBlock.boolConditions[i].operatorID, 0); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); //SimpleLayout.Space(4); // VALUE 2 SimpleLayout.BeginHorizontal(); GetBoolField.BuildEventField("Value 2:", eventBlock.boolConditions[i].itemB, heroObject); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); // COLUMN 1: END -------------------------------------- // COLUMN 2: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Button(Content.DeleteIcon, deleteBoolCondition, i, Button.StyleA, 25); SimpleLayout.EndVertical(); // COLUMN 2: END -------------------------------------- SimpleLayout.EndHorizontal(); // ROW 1: END ----------------------------------------- // ROW 2: START --------------------------------------- if (i < eventBlock.boolConditions.Count - 1) { SimpleLayout.Line(); } // ROW 2: END ----------------------------------------- } SimpleLayout.EndVertical(); }