Exemplo n.º 1
0
    private void Awake()
    {
        diceSpawner = FindObjectOfType <DiceSpawner>();
        gameScore   = FindObjectOfType <GameScore>();
        button      = GetComponent <Button>();

        upgradePrice = PlayerPrefs.GetInt(PlayerPrefsKey.AutoSpawnMultiplierPrice.ToString());
        if (upgradePrice <= 0)
        {
            upgradePrice = upgrade.price;
        }

        if (PlayerPrefs.HasKey(PlayerPrefsKey.AutoSpawnCount.ToString()))
        {
            boughtUpgrades = PlayerPrefs.GetInt(PlayerPrefsKey.AutoSpawnCount.ToString());
        }

        var buttonInteractable = boughtUpgrades > 1;

        button.interactable = buttonInteractable;
        if (buttonInteractable)
        {
            gameScore.tutorialModes[1] = TutorialMode.WAS_SHOWING;
        }

        buttonDiceCountLabelText = buttonDiceCountText.text;
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     playerManager = GameObject.FindObjectOfType <PlayerManager>();
     showHover     = this.GetComponent <ShowHover>();
     diceSpawner   = this.GetComponent <DiceSpawner>();
     hand          = GameObject.FindObjectOfType <Hand>();
     if (isLocalPlayer)
     {
         playerManager.localPlayer = this;
     }
     playerManager.players.Add(this);
     playerID = playerManager.players.IndexOf(this);
 }
Exemplo n.º 3
0
    private void Awake()
    {
        diceSpawner     = FindObjectOfType <DiceSpawner>();
        gameScore       = FindObjectOfType <GameScore>();
        button          = GetComponent <Button>();
        buttonPriceText = GetComponentInChildren <TextMeshProUGUI>();

        upgradePrice = PlayerPrefs.GetInt(PlayerPrefsKey.AutoSpawnerPrice.ToString());
        if (upgradePrice <= 0)
        {
            upgradePrice = upgrade.price;
        }
        else
        {
            gameScore.tutorialModes[0] = TutorialMode.WAS_SHOWING;
        }

        UpdateButtonText();
    }