Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     backToSplash = FindObjectOfType <BackToSplash>();
     manager      = FindObjectOfType <Manager>();
     gameData     = FindObjectOfType <GameData>();
     buttonImage  = GetComponent <Image>();
     myButton     = GetComponent <Button>();
     board        = FindObjectOfType <Board>();
     LoadData();
     ActiveStars();
     ShowLevel();
     DecideSprite();
 }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        backgroundMusic = GetComponent <AudioSource>();
        SoundScript.Play(splashMusic);
        Debug.Log("Menu" + PlayerPrefs.GetInt("musicGame"));


        Loade();

        StartCoroutine(RestoreRoutine());

        gameData   = FindObjectOfType <GameData>();
        backSplash = FindObjectOfType <BackToSplash>();


        int tutal       = PlayerPrefs.GetInt("totalEnergy");
        int firstEnergy = PlayerPrefs.GetInt("FirstE");

        if (tutal == 1 && firstEnergy != 1)
        {
            PlayerPrefs.SetInt("totalEnergy", 5);
            Loade();

            StartCoroutine(RestoreRoutine());
        }
        else
        {
            Loade();

            StartCoroutine(RestoreRoutine());
        }
        coin = PlayerPrefs.GetInt("Coin");
        int firstCoin = PlayerPrefs.GetInt("First");

        if (coin == 0 && firstCoin != 1)
        {
            coinText.text = "" + 1000;
            PlayerPrefs.SetInt("Coin", 1000);
        }
        else
        {
            coinText.text = coin.ToString();
        }
    }