void OnContextualPanelChanged() { //Only execute if it's the right kind of contextual panel if (ContextualPanelData.isOfType(typeof(NewSubactionContextPanel))) { NewSubactionContextPanel panel = (NewSubactionContextPanel)LegacyEditorData.contextualPanel; if (panel.selectedTypeDirty) { //Clear away all the old buttons foreach (GameObject child in children) { NGUITools.Destroy(child); } children.Clear(); foreach (SubactionDataDefault subData in subactionsByCategory[panel.selectedType]) { instantiateSubactionButton(subData); } //Realign the grid grid.Reposition(); //dragPanel.ResetPosition(); } } }
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); } } }
void OnContextualPanelChanged() { //Only execute if it's the right kind of contextual panel if (ContextualPanelData.isOfType(typeof(NewSubactionContextPanel))) { NewSubactionContextPanel panel = (NewSubactionContextPanel)LegacyEditorData.contextualPanel; if (panel.selectedType == subtype) { NGUITools.SetActive(selectedSprite, true); NGUITools.SetActive(unselectedSprite, false); } else { NGUITools.SetActive(selectedSprite, false); NGUITools.SetActive(unselectedSprite, true); } } }