public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 23); //----------------------------------------- // 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); bool changeAnims = GetBoolValue.BuildField("Change Movement Animation?", actionParams, heroAction.actionFields[1], true); if (changeAnims) { SimpleLayout.Line(); SimpleLayout.Label("Enter the name of the bool for each animation you want to change. The bools are stored in the " + "animator controller that is assigned to the hero object. " + "If you leave a field blank, the animation won't be changed for that field.", true); SimpleLayout.Line(); GetStringField.BuildFieldA("Move Default", actionParams, heroAction.actionFields[5]); GetStringField.BuildFieldA("Move Left", actionParams, heroAction.actionFields[6]); GetStringField.BuildFieldA("Move Right", actionParams, heroAction.actionFields[7]); GetStringField.BuildFieldA("Move Up", actionParams, heroAction.actionFields[8]); GetStringField.BuildFieldA("Move Down", actionParams, heroAction.actionFields[9]); GetStringField.BuildFieldA("Move Up Left", actionParams, heroAction.actionFields[10]); GetStringField.BuildFieldA("Move Up Right", actionParams, heroAction.actionFields[11]); GetStringField.BuildFieldA("Move Down Left", actionParams, heroAction.actionFields[12]); GetStringField.BuildFieldA("Move Down Right", actionParams, heroAction.actionFields[13]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeFace = GetBoolValue.BuildField("Change Face Direction Animation?", actionParams, heroAction.actionFields[2], true); if (changeFace) { SimpleLayout.Line(); SimpleLayout.Label("Enter the name of the bool for each animation you want to change. The bools are stored in the " + "animator controller that is assigned to the hero object. " + "If you leave a field blank, the animation won't be changed for that field.", true); SimpleLayout.Line(); GetStringField.BuildFieldA("Face Default", actionParams, heroAction.actionFields[14]); GetStringField.BuildFieldA("Face Left", actionParams, heroAction.actionFields[15]); GetStringField.BuildFieldA("Face Right", actionParams, heroAction.actionFields[16]); GetStringField.BuildFieldA("Face Up", actionParams, heroAction.actionFields[17]); GetStringField.BuildFieldA("Face Down", actionParams, heroAction.actionFields[18]); GetStringField.BuildFieldA("Face Up Left", actionParams, heroAction.actionFields[19]); GetStringField.BuildFieldA("Face Up Right", actionParams, heroAction.actionFields[20]); GetStringField.BuildFieldA("Face Down Left", actionParams, heroAction.actionFields[21]); GetStringField.BuildFieldA("Face Down Right", actionParams, heroAction.actionFields[22]); } SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 24); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changePrintSettings = GetBoolValue.BuildField("Change print message settings?", actionParams, heroAction.actionFields[0], true); if (changePrintSettings) { bool printMessage = GetBoolValue.BuildField("Print message character by character?", actionParams, heroAction.actionFields[1], true); if (printMessage) { GetSliderValue.BuildFieldB("Speed:", actionParams, heroAction.actionFields[2], 0, 100, true); } } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeAlignment = GetBoolValue.BuildField("Change alignment of message?", actionParams, heroAction.actionFields[3], true); if (changeAlignment) { string[] alignmentTypes = { "Top Left", "Top Center", "Top Right", "Middle Left", "Middle Center", "Middle Right", "Bottom Left", "Bottom Center", "Bottom Right", }; GetDropDownField.BuildField("", actionParams, heroAction.actionFields[4], new GenericListField(alignmentTypes)); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeBackgroundSettings = GetBoolValue.BuildField("Change background alpha?", actionParams, heroAction.actionFields[5], true); if (changeBackgroundSettings) { GetSliderValue.BuildFieldB("", actionParams, heroAction.actionFields[6], 0, 100, true); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeBackgroundImage = GetBoolValue.BuildField("Change background image?", actionParams, heroAction.actionFields[7], true); if (changeBackgroundImage) { GetUnityObjectField.BuildFieldA <Sprite>("", actionParams, heroAction.actionFields[8]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeButtonImage = GetBoolValue.BuildField("Change button image?", actionParams, heroAction.actionFields[9], true); if (changeButtonImage) { GetUnityObjectField.BuildFieldA <Sprite>("", actionParams, heroAction.actionFields[10]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeButtonLayout = GetBoolValue.BuildField("Change button layout?", actionParams, heroAction.actionFields[11], true); if (changeButtonLayout) { string[] items = { "Horizontal", "Vertical" }; GetDropDownField.BuildField("", actionParams, heroAction.actionFields[12], new GenericListField(items)); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeTextColor = GetBoolValue.BuildField("Change text body color?", actionParams, heroAction.actionFields[13], true); if (changeTextColor) { GetColorValue.BuildField("", actionParams, heroAction.actionFields[14]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeHeadingColor = GetBoolValue.BuildField("Change text heading color?", actionParams, heroAction.actionFields[15], true); if (changeHeadingColor) { GetColorValue.BuildField("", actionParams, heroAction.actionFields[16]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeButtonTextColor = GetBoolValue.BuildField("Change button text color?", actionParams, heroAction.actionFields[17], true); if (changeButtonTextColor) { GetColorValue.BuildField("", actionParams, heroAction.actionFields[18]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeButtonAlpha = GetBoolValue.BuildField("Change background button alpha?", actionParams, heroAction.actionFields[19], true); if (changeButtonAlpha) { GetSliderValue.BuildFieldB("", actionParams, heroAction.actionFields[20], 0, 100, true); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeButtonActiveColor = GetBoolValue.BuildField("Change selected button color?", actionParams, heroAction.actionFields[21], true); if (changeButtonActiveColor) { GetColorValue.BuildField("", actionParams, heroAction.actionFields[22]); } SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 20); //----------------------------------------- // create the fields for this action //----------------------------------------- // spawn object from a pool? SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool usePool = GetBoolValue.BuildField("Spawn from pool? (Yes=True, No=False)", actionParams, heroAction.actionFields[1], true); if (usePool) { GetStringField.BuildFieldA("", actionParams, heroAction.actionFields[2]); } SimpleLayout.EndVertical(); // spawn from hero object (1) or prefab (2) SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); string[] items = { "Spawn object from Hero Object", "Spawn object from Prefab" }; int result = GetDropDownField.BuildField("Spawn the object from:", actionParams, heroAction.actionFields[0], new GenericListField(items)); if (result == 1) { GetHeroObjectField.BuildFieldC("Hero Object:", actionParams, heroAction.actionFields[3]); GetBoolValue.BuildField("Debug this Hero Object?", actionParams, heroAction.actionFields[4], true); GetBoolValue.BuildField("Don't save this Hero Object?", actionParams, heroAction.actionFields[5], true); } else if (result == 2) { if (!usePool) { GetPrefabValue.BuildField("Prefab:", actionParams, heroAction.actionFields[5]); } } SimpleLayout.EndVertical(); // change position? SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changePos = GetBoolValue.BuildField("Change position?", actionParams, heroAction.actionFields[6], true); if (changePos) { GetCoordinatesField.BuildField("", actionParams, heroAction.actionFields[7], heroAction.actionFields[8], heroAction.actionFields[9], heroAction.actionFields[10], heroAction.actionFields[11], heroAction.actionFields[12]); } SimpleLayout.EndVertical(); // change rotation? SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeRotation = GetBoolValue.BuildField("Change rotation?", actionParams, heroAction.actionFields[13], true); if (changeRotation) { GetCoordinatesField.BuildField("", actionParams, heroAction.actionFields[14], heroAction.actionFields[15], heroAction.actionFields[16], heroAction.actionFields[17], heroAction.actionFields[18], heroAction.actionFields[19]); } SimpleLayout.EndVertical(); }