private void Start() { label.text = CreateHitboxEditContextPanel.StringFromCategory(hitboxCategory); HitboxContextChangeCategory legacyAction = ScriptableObject.CreateInstance <HitboxContextChangeCategory>(); legacyAction.init(hitboxCategory); 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(CreateHitboxEditContextPanel))) { executingPanelData = (CreateHitboxEditContextPanel)LegacyEditorData.contextualPanel; previousCategory = executingPanelData.selectedCategory; executingPanelData.selectedCategory = nextCategory; executingPanelData.FireContextualPanelChange(); } else { throw new System.Exception("Attempting to use NewSubactionChangeSubactionType from a Contextual Panel other than NewSubactionContextPanel"); } }
void OnContextualPanelChanged() { //Only execute if it's the right kind of contextual panel if (ContextualPanelData.isOfType(typeof(CreateHitboxEditContextPanel))) { CreateHitboxEditContextPanel panel = (CreateHitboxEditContextPanel)LegacyEditorData.contextualPanel; if (panel.selectedCategory == showWhenCategory) { NGUITools.SetActive(panelToShow, true); } else { NGUITools.SetActive(panelToShow, false); } } }