コード例 #1
0
    public void lockAll()
    {
        //lock all is also only used during testing
        StaticVariables.unlockedMedium      = false;
        StaticVariables.unlockedLarge       = false;
        StaticVariables.unlockedHuge        = false;
        StaticVariables.highestUnlockedSize = 3;
        StaticVariables.showMed             = false;
        StaticVariables.showLarge           = false;
        StaticVariables.showHuge            = false;

        StaticVariables.unlockedNotes1 = false;
        StaticVariables.unlockedNotes2 = false;
        StaticVariables.unlockedResidentsChangeColor = false;
        StaticVariables.unlockedUndoRedo             = false;
        StaticVariables.unlockedRemoveAllOfNumber    = false;
        StaticVariables.unlockedClearPuzzle          = false;
        StaticVariables.unlockedHighlightBuildings   = false;

        StaticVariables.includeNotes1Button = false;
        StaticVariables.includeNotes2Button = false;
        StaticVariables.changeResidentColorOnCorrectRows = false;
        StaticVariables.includeUndoRedo           = false;
        StaticVariables.includeRemoveAllOfNumber  = false;
        StaticVariables.includeClearPuzzle        = false;
        StaticVariables.includeHighlightBuildings = false;

        StaticVariables.unlockedSkins = new List <Skin>();
        StaticVariables.skin          = InterfaceFunctions.getDefaultSkin();
        background.GetComponent <SpriteRenderer>().sprite = StaticVariables.skin.shopBackground;
        InterfaceFunctions.colorMenuButton(menuButton);
        updateButtons();
    }
コード例 #2
0
    private void Start()
    {
        //set some private variables based on elements edited by the inspector
        ColorUtility.TryParseHtmlString(affordableCoinColor, out affordableColor);
        ColorUtility.TryParseHtmlString(unaffordableCoinColor, out unaffordableColor);
        ColorUtility.TryParseHtmlString(purchaseButtonExterior, out purchaseButtonExteriorColor);
        ColorUtility.TryParseHtmlString(purchaseButtonInterior, out purchaseButtonInteriorColor);
        ColorUtility.TryParseHtmlString(noPurchaseButtonExterior, out noPurchaseButtonExteriorColor);
        ColorUtility.TryParseHtmlString(noPurchaseButtonInterior, out noPurchaseButtonInteriorColor);
        sprite1s     = coinsBox1s.GetComponent <SpriteRenderer>();
        sprite10s    = coinsBox10s.GetComponent <SpriteRenderer>();
        sprite100s   = coinsBox100s.GetComponent <SpriteRenderer>();
        sprite1000s  = coinsBox1000s.GetComponent <SpriteRenderer>();
        sprite10000s = coinsBox10000s.GetComponent <SpriteRenderer>();
        blackSprite  = blackForeground.GetComponent <SpriteRenderer>();

        //show the amount of coins the player has, and also the cost of various upgrades
        displayCoinsAmount();
        displayCoinsOnButton(expandMedButton, medCityPrice);
        displayCoinsOnButton(expandLargeButton, largeCityPrice);
        displayCoinsOnButton(expandHugeButton, hugeCityPrice);
        displayCoinsOnButton(expandNotes1Button, notes1Price);
        displayCoinsOnButton(expandNotes2Button, notes2Price);
        displayCoinsOnButton(expandResidentColorButton, residentColorPrice);
        displayCoinsOnButton(expandUndoRedoButton, undoRedoPrice);
        displayCoinsOnButton(expandRemoveAllButton, removeAllPrice);
        displayCoinsOnButton(expandClearButton, clearPrice);
        displayCoinsOnButton(expandHighlightBuildingsButton, highlightBuildingsPrice);

        //show the cost of the various skins
        findSkinButtons();
        foreach (GameObject parent in skinButtons)
        {
            displayCoinsOnButton(parent.transform.Find("Expand Button").gameObject, getSkinPrice((InterfaceFunctions.getSkinFromName(parent.name))));
        }

        //update the buttons for the various upgrades to denote if they can be purchased right now
        updateButtons();

        //apply the cosmetics from the current skin
        background.GetComponent <SpriteRenderer>().sprite = StaticVariables.skin.shopBackground;
        InterfaceFunctions.colorMenuButton(menuButton);

        //starts the fade-in process, which is carried out in the Update function
        if (StaticVariables.isFading && StaticVariables.fadingTo == "shop")
        {
            fadeTimer = fadeInTime;
        }

        //determine the full scope of the scroll view, determined by what elements are expanded within the scrollview
        setScrollViewHeight();
    }
コード例 #3
0
    private void Start()
    {
        //apply the cosmetics from the current skin
        background.GetComponent <SpriteRenderer>().sprite = StaticVariables.skin.shopBackground;
        blackSprite = blackForeground.GetComponent <SpriteRenderer>();
        InterfaceFunctions.colorMenuButton(menuButton);

        //starts the fade-in process, which is carried out in the Update function
        if (StaticVariables.isFading && StaticVariables.fadingTo == "credits")
        {
            fadeTimer = fadeInTime;
        }
    }
コード例 #4
0
    public void unlockSkin(GameObject parent)
    {
        Skin skin = InterfaceFunctions.getSkinFromName(parent.name);

        if (canPurchase(StaticVariables.unlockedSkins.Contains(skin), getSkinPrice(skin)))
        {
            StaticVariables.unlockedSkins.Add(skin);
            StaticVariables.skin = skin;
            background.GetComponent <SpriteRenderer>().sprite = StaticVariables.skin.shopBackground;
            InterfaceFunctions.colorMenuButton(menuButton);
            doPurchase(getSkinPrice(skin));
        }
    }
コード例 #5
0
    // ---------------------------------------------------
    //ALL OF THE FUNCTIONS THAT ARE USED TO UPDATE THE VISUALS FOR THE MAIN MENU SCENE
    // ---------------------------------------------------

    private void colorButtons()
    {
        //color all of the menu buttons to fit the current skin
        InterfaceFunctions.colorMenuButton(puzzleButtons.transform.Find("3").gameObject);
        InterfaceFunctions.colorMenuButton(puzzleButtons.transform.Find("4").gameObject);
        InterfaceFunctions.colorMenuButton(puzzleButtons.transform.Find("5").gameObject);
        InterfaceFunctions.colorMenuButton(puzzleButtons.transform.Find("6").gameObject);

        InterfaceFunctions.colorMenuButton(returnOrAbandonButtons.transform.Find("Popup").Find("Return").gameObject);
        InterfaceFunctions.colorMenuButton(returnOrAbandonButtons.transform.Find("Popup").Find("Abandon").gameObject);

        Color exter;
        Color inter;

        ColorUtility.TryParseHtmlString(StaticVariables.skin.resumePuzzleExterior, out exter);
        ColorUtility.TryParseHtmlString(StaticVariables.skin.resumePuzzleInterior, out inter);
        returnOrAbandonButtons.transform.Find("Popup").Find("Backdrop").Find("Border").GetComponent <SpriteRenderer>().color   = exter;
        returnOrAbandonButtons.transform.Find("Popup").Find("Backdrop").Find("Interior").GetComponent <SpriteRenderer>().color = inter;

        InterfaceFunctions.colorMenuButton(shopButton);
        InterfaceFunctions.colorMenuButton(tutorialButton);
        InterfaceFunctions.colorMenuButton(settingsButton);
        InterfaceFunctions.colorMenuButton(largeCenterTutorialButton);
    }
コード例 #6
0
 private void loadSkin()
 {
     //updates the visuals of the settings scene based on what skin is used
     background.GetComponent <SpriteRenderer>().sprite = StaticVariables.skin.shopBackground;
     InterfaceFunctions.colorMenuButton(menuButton);
 }