Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / Player / PlayerGold.cs
@Rackday Rackday on 18 Aug 647 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayerGold : MonoBehaviour
{
    //Files
    private OpenUpgrades openUpgrades;

    //Ints
    public int gold;

    //Texts
    public Text goldText;
    public Text goldTextUpgrades;

    private void Start()
    {
        openUpgrades = FindObjectOfType<OpenUpgrades>();
        gold = PlayerData.loginInfo.score;
    }

    // Update is called once per frame
    void Update()
    {
        goldText.text = "" + gold;
        if (openUpgrades != null)
        {
            goldTextUpgrades.text = "" + gold;
        }
    }
}