Esempio n. 1
0
    public void EnablePanel(string panelName)
    {
        foreach (GameObject go in panels)
        {
            if (go.activeSelf)
            {
                go.GetComponent <PanelBounce>().Close();
                go.SetActive(false);
                if (go.transform.Find("Info Button/Info Panel") != null && go.transform.Find("Info Button/Info Panel").gameObject.activeSelf)
                {
                    go.transform.Find("Info Button/Info Panel").gameObject.SetActive(false);
                }
            }
        }

        if (panelName == "Stats Panel")
        {
            UpdateBars();
            ageText.GetComponent <TextMeshProUGUI>().text = GetAgeOfDoug();
        }

        if (panelName == "Store Panel")
        {
            WallpaperNum currentWallpaper = PersistentGameManager.instance.playerData.playerData.unlockedWallpaper;
            float        nextCost         = (currentWallpaper < WallpaperNumMethods.getMaxPurchasableWallpaperNum()) ? GlobalConfig.wallpaperCosts[currentWallpaper + 1] : 0;

            buyText.GetComponent <TextMeshProUGUI>().color =
                (PersistentGameManager.instance.playerData.playerData.coinz >= ((currentWallpaper < WallpaperNumMethods.getMaxPurchasableWallpaperNum()) ? GlobalConfig.wallpaperCosts[currentWallpaper + 1] : 0))
                ? GlobalConfig.textColor : GlobalConfig.disabledTextColor;

            string t = "buy {0}:\n{1} coinz";

            if ((int)currentWallpaper < (int)WallpaperNumMethods.getMaxPurchasableWallpaperNum())
            {
                t = t.Replace("{0}", GlobalConfig.wallpaperNames[(int)currentWallpaper + 1]);
            }
            else
            {
                t = "all wallpapers have been bought!";
            }
            t = t.Replace("{1}", ClickerManager.ConvertToShortNumber(nextCost));

            buyText.GetComponent <TextMeshProUGUI>().text = t;
        }

        foreach (GameObject go in panels)
        {
            if (go.name == panelName)
            {
                go.SetActive(true);
            }
        }
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("CheckDeactivateDoug", 0f, 60f * 1f);
        doug.transform.localScale = new Vector3(dougSpriteDefaultScale.x * GetDougWeightScale(), dougSpriteDefaultScale.y, dougSpriteDefaultScale.z);
        dougSpriteDefaultPosition = doug.transform.position;

        if (PersistentGameManager.instance != null)
        {
            PersistentGameManager.instance.SaveGame();
            coinzText.GetComponent <TextMeshProUGUI>().text = ClickerManager.ConvertToShortNumber(PersistentGameManager.instance.playerData.playerData.coinz) + " coinz";
            PersistentGameManager.instance.LoadWallpaperButtons();
            UpdateText();
            UpdateMinigameText();
            UpdateBars();
            CheckDeactivateDoug();
            UpdateWallpaperButtons();
        }
    }
Esempio n. 3
0
    public void UpdateText()
    {
        coinzText.GetComponent <TextMeshProUGUI>().text = ClickerManager.ConvertToShortNumber(PersistentGameManager.instance.playerData.playerData.coinz) + " coinz";
        ageText.GetComponent <TextMeshProUGUI>().text   = GetAgeOfDoug();
        if (PlayerPrefs.GetInt("soundEnabled") == 1)
        {
            toggleSoundButtonText.GetComponent <TextMeshProUGUI>().text = "sound: on";
        }
        else
        {
            toggleSoundButtonText.GetComponent <TextMeshProUGUI>().text = "sound: off";
        }
        if (PlayerPrefs.GetInt("musicEnabled") == 1)
        {
            toggleMusicButtonText.GetComponent <TextMeshProUGUI>().text = "music: on";
        }
        else
        {
            toggleMusicButtonText.GetComponent <TextMeshProUGUI>().text = "music: off";
        }

        if (PersistentGameManager.instance.playerData.playerData.unlockedFlippy)
        {
            unlockPanel.transform.Find("Unlock Text").GetComponent <TextMeshProUGUI>().text = "you shouldn't be able to see this!";
        }
        else if (PersistentGameManager.instance.playerData.playerData.unlockedGuessing)
        {
            unlockPanel.transform.Find("Unlock Layout/Yes Button/Text (TMP)").GetComponent <TextMeshProUGUI>().color =
                (PersistentGameManager.instance.playerData.playerData.love > 100f) ? GlobalConfig.textColor : GlobalConfig.disabledTextColor;
            unlockPanel.transform.Find("Unlock Text").GetComponent <TextMeshProUGUI>().text = "spend 100 luv to unlock flippy doug?";
        }
        else
        {
            unlockPanel.transform.Find("Unlock Layout/Yes Button/Text (TMP)").GetComponent <TextMeshProUGUI>().color =
                (PersistentGameManager.instance.playerData.playerData.love > 100f) ? GlobalConfig.textColor : GlobalConfig.disabledTextColor;
            unlockPanel.transform.Find("Unlock Text").GetComponent <TextMeshProUGUI>().text = "spend 100 luv to unlock find the bisco?";
        }
    }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     coinzText.GetComponent <TextMeshProUGUI>().text = ClickerManager.ConvertToShortNumber(PersistentGameManager.instance.playerData.playerData.coinz) + " coinz";
 }