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); GetHeroObjectField.BuildFieldE("The script with the property is 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 on the hero object:", actionParams, heroAction.actionFields[2]); // select the property to change if (script != null) { GetPropertyField.BuildFieldC("The property in the script to save on the hero object:", actionParams, heroAction.actionFields[3], heroAction.actionFields[4], script); } 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(); } }