private void instantiateButton(SubactionType subType) { GameObject go = NGUITools.AddChild(gameObject, typeButtonPrefab); SubactionTypeButton button = go.GetComponent <SubactionTypeButton>(); button.SetSubType(subType); children.Add(go); }
public void SetSubType(SubactionType sub) { subtype = sub; label.text = SubactionUtilities.TypeToString(sub); NewSubactionChangeSubactionType legacyAction = ScriptableObject.CreateInstance <NewSubactionChangeSubactionType>(); legacyAction.init(sub); GetComponent <OnClickSendAction>().action = legacyAction; }
public override void execute() { //This should only ever be run in the new subaction context panel. Otherwise, throw error if (ContextualPanelData.isOfType(typeof(NewSubactionContextPanel))) { executingPanelData = (NewSubactionContextPanel)LegacyEditorData.contextualPanel; previousType = executingPanelData.selectedType; executingPanelData.selectedType = nextType; executingPanelData.FireContextualPanelChange(); } else { throw new System.Exception("Attempting to use NewSubactionChangeSubactionType from a Contextual Panel other than NewSubactionContextPanel"); } }
public static string TypeToString(SubactionType subType) { switch (subType) { case SubactionType.CONTROL: return("Control"); case SubactionType.BEHAVIOR: return("Behavior"); case SubactionType.ANIMATION: return("Animation"); case SubactionType.HITBOX: return("Hitbox"); case SubactionType.OTHER: return("Other"); default: throw new System.NotImplementedException("Subaction Type not recognized. Please add string to SubactionUtilities. " + subType); } }
public void init(SubactionType subType) { nextType = subType; }
public SubactionData(string name, SubactionType subT, SubVarDict args) { SubactionName = name; subType = subT; arguments = args; }