Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        savePath = Application.dataPath + "/savedata.json";

        rb2d               = GetComponent <Rigidbody2D>();
        anim               = GetComponent <Animator>();
        isColliding        = false;
        plowedGround       = Resources.Load <GameObject>("Prefabs/PlowedGround_Dry");
        moneyScript        = GameObject.Find("MoneyAmount").GetComponent <MoneyScript>();
        equippedItemScript = GameObject.Find("ItemBackground").GetComponent <EquippedItemScript>();
        pauseMenuScript    = GameObject.Find("GameUI").GetComponent <PauseMenuScript>();

        currentlyEquipped = "none";

        money = 100;

        equippedItemScript.EmptyEquippedItem();

        LoadData();
        Debug.Log("Game Loaded");

        moneyScript.UpdateMoneyText(money);
    }
Esempio n. 2
0
 public void AddMoney(int AmountOfMoney)
 {
     money += AmountOfMoney;
     moneyScript.UpdateMoneyText(money);
 }