Exemplo n.º 1
0
    public void SetModuleSetSelectionChange(ModuleSetButton newSelectedButton)
    {
        if (selectedButton != newSelectedButton)
        {
            if (selectedButton != null)
            {
                selectedButton.SetHighlight(false);
            }

            selectedButton = newSelectedButton;
            selectedButton.SetHighlight(true);
        }
    }
Exemplo n.º 2
0
    public void BuildModuleSetsButtons(List <ModuleSet> ModuleSets, ModuleSetButton.ButtonPress ChangeModuleSet)
    {
        Clear();
        selectedButton = null;

        foreach (ModuleSet moduleSet in ModuleSets)
        {
            GameObject      buttonObject = InstantiateEntry(moduleSet.GetName());
            ModuleSetButton newButton    = buttonObject.GetComponent <ModuleSetButton>();
            newButton.SetModuleSet(moduleSet, ChangeModuleSet, SetModuleSetSelectionChange);

            if (selectedButton == null)
            {
                selectedButton = newButton;
                selectedButton.SetHighlight(true);
                ChangeModuleSet(moduleSet);
            }
        }
    }