Пример #1
0
    public static void GameStarts()
    {
        if (!PlayerPrefs.HasKey("played games"))
        {
            PlayerPrefs.SetInt("played games", 0);
        }

        if (Application.loadedLevel != 1)
        {
            column_pool      = GameObject.Find("Physical columns pool").GetComponent <Pool>();
            roof_column_pool = GameObject.Find("Roof columns pool").GetComponent <Pool>();
            coin_pool        = GameObject.Find("Coin pool").GetComponent <Coin_pool>();
            saw_pool         = GameObject.Find("Saws pool").GetComponent <Pool>();
            rolling_saw_pool = GameObject.Find("Rolling saws pool").GetComponent <Pool>();
            roof_saw_pool    = GameObject.Find("Roof saws pool").GetComponent <Pool>();

            PlayerPrefs.SetInt("played games", PlayerPrefs.GetInt("played games") + 1);
        }

        if (!PlayerPrefs.HasKey("coins"))
        {
            PlayerPrefs.SetInt("coins", 0);
        }
        coins = PlayerPrefs.GetInt("coins");

        if (!PlayerPrefs.HasKey("high score"))
        {
            PlayerPrefs.SetInt("high score", 0);
        }
        high_score = PlayerPrefs.GetInt("high score");

        number_of_played_games = PlayerPrefs.GetInt("played games");
    }
Пример #2
0
 void Start()
 {
     coin_parent      = GameObject.Find("Coins").transform;
     coin_pool        = GameObject.Find("Coin pool").GetComponent <Coin_pool>();
     number_of_shapes = coin_pool.number_of_shapes;
 }