Пример #1
0
    public void CreateCrops()
    {
        //--------TODO-------
        //Area levels will have different rights to build and more to unlock
        //e.g area level 1 until 2 = 5 wells

        // Different upgrades
        // 5 crops plots = a field? but u have to pay for the upgrade.
        bool valid = false;


        //Purchase + funds Check
        if (CharacterCreator.currentPlayerCoin >= 10)
        {
            CharacterCreator.currentPlayerCoin = CharacterCreator.currentPlayerCoin - purchaseCropsObjects[0].Cost;



            ch.setPlayerCoin();

            valid = true;
            Debug.Log("Crops purchase");
        }
        else
        {
            Debug.Log("Not enough funds - 10 coins are needed");
        }

        if (valid == true)
        {
            Debug.Log("creating crops plot");
            // Create well on screen --TODO!!!


            //Storage - Player Storage/SAVE

            // add Timer + add food
            statsManager.increaseHungerMethod(); // TEMP for now ,  have a variable to change if true hunger + 5 etc
            statsManager.PlayerLevelCheck();


            validInstantiate = true; // Allows SpawnObject Script to call method which spawns prefab


            //Create waterWell / Prefab on screen
            spawnObjects.SetItemCrops(CropsPrefab);
            spawnObjects.name = "Crops";
        }
    }