Esempio n. 1
0
    private void OnEnable()
    {
        uISpellsManager = GetComponent <UISpellsManager> ();
        uIMenuManager   = GetComponent <UIMenuManager> ();
        uIInfoPanel     = GetComponent <UIInfoPanel> ();

        var rootGameUI = uiGame.rootVisualElement;

        var rootSpellsUI = uiSpellsPanel.rootVisualElement;

        uISpellsManager.SetRootAndInit(rootSpellsUI);
        uIInfoPanel.SetRootAndInit(rootSpellsUI);

        var rootMenuUI = uiMenu.rootVisualElement;

        uIMenuManager.SetRootAndInit(rootMenuUI);

        menuButton   = rootGameUI.Query <Button> ("menu");
        speedButton  = rootGameUI.Query <Button> ("speed");
        spellsButton = rootGameUI.Query <Button> ("spells-button");

        prepareIcon = rootGameUI.Query <IMGUIContainer> ("prepare-bar-icon");

        messageScreen = rootGameUI.Query <VisualElement> ("message-screen");
        defenceBar    = rootGameUI.Query <VisualElement> ("defence-bar-line");
        manaBar       = rootGameUI.Query <VisualElement> ("mana-bar-line");
        prepareBar    = rootGameUI.Query <VisualElement> ("prepare-bar-line");
        gamePanel     = rootGameUI.Query <VisualElement> ("game-panel");

        //Labels
        messageLabel = rootGameUI.Query <Label> ("message");
        manaValue    = rootGameUI.Query <Label> ("mana-bar-value");
        defenceValue = rootGameUI.Query <Label> ("defence-bar-value");
        spellsText   = rootGameUI.Query <Label> ("spells-txt");
        FontUtilities.SetFontSize42(spellsText);
        spellsNumber = rootGameUI.Query <Label> ("spells-number");
        FontUtilities.SetFontSize42(spellsNumber);
        xPText = rootGameUI.Query <Label> ("exp-text");
        FontUtilities.SetFontSize42(xPText);
        xPoints = rootGameUI.Query <Label> ("exp-number");
        FontUtilities.SetFontSize42(xPoints);
    }