Ejemplo n.º 1
0
    void setActifARandomRaid()
    {
        PlayerPrefs.SetInt("food", cityScript.Get_food());
        PlayerPrefs.SetInt("people", cityScript.Get_people());
        PlayerPrefs.SetInt("souls", cityScript.Get_souls());
        PlayerPrefs.SetInt("numberOfFieldsLVL1", cityScript.GetNumberOfFieldsLVL1());
        PlayerPrefs.SetInt("numberOfFieldsLVL2", cityScript.GetNumberOfFieldsLVL2());
        PlayerPrefs.SetInt("numberOfHousesLVL1", cityScript.GetNumberOfHousesLVL1());
        PlayerPrefs.SetInt("numberOfHousesLVL2", cityScript.GetNumberOfHousesLVL2());
        PlayerPrefs.SetInt("lunarCycleNumber", cityScript.GetLunarCycleNumber());
        PlayerPrefs.SetInt("timer", cityScript.getTimer());

        PlayerPrefs.SetFloat("ourRessourceSent", cityScript.Get_people());

        float randomEnnemyForce = Random.Range(60, 140) / 100.0f;

        PlayerPrefs.SetFloat("enemyRessource", cityScript.Get_people() * randomEnnemyForce);

        SceneManager.LoadScene(4);
    }
Ejemplo n.º 2
0
    private void Start()
    {
        numberOfDisasters = 0;

        cityScript = cityGameObject.GetComponent <CityShems>();
        for (int i = 0; i < canvaDisaster.transform.childCount; i++)
        {
            my_disasters.Add(canvaDisaster.transform.GetChild(i).gameObject);
            numberOfDisasters++;
        }
        if (numberOfDisasters == 0)
        {
            Debug.Log("Not enought disasters");
        }
        currentLunarCycleNumber = cityScript.GetLunarCycleNumber();
        pauseText.text          = "";
    }