2themoon/Assets/Scripts/GameManager.cs
2023-01-23 11:03:36 +05:30

17 lines
501 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameManager : MonoBehaviour
{
public Text txt_money;
public float moneyMultiplier = 5;
public Vector3 txtMoneyOffset = Vector2.one;
void Update(){
txt_money.text = "$"+(PlayerController.t.position.y*moneyMultiplier).ToString("n4");
txt_money.rectTransform.position = Camera.main.WorldToScreenPoint(PlayerController.t.position + txtMoneyOffset);
}
}