Exemplo n.º 1
0
    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(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");
     }
 }
Exemplo n.º 3
0
 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);
         }
     }
 }