Cute_demon_attacks/meng_yao/Assets/script/Panel/AssestPanel.cs

53 lines
1.1 KiB
C#
Raw Normal View History

2024-10-30 21:49:13 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AssestPanel : MonoBehaviour
{
public static AssestPanel instance;
public Text Stone;
public Text Coin;
public Text Ore;
public Text Forging;
void Start()
{
instance = this;
Stone.text = PlayerManager.Instance.Stones.ToString();
Forging.text=PlayerManager.Instance.Forging.ToString();
Coin.text=PlayerManager.Instance.Coins.ToString();
Ore.text=PlayerManager.Instance.Ore.ToString();
}
public void SetStoneText(float num)
{
if (Stone!=null)
{
Stone.text=num.ToString();
}
}
public void SetCoinText(float num)
{
if (Coin != null)
{
Coin.text = num.ToString();
}
}
public void SetOreText(float num)
{
if (Ore != null)
{
Ore.text = num.ToString();
}
}
public void SetForgingText(float num)
{
if (Forging != null)
{
Forging.text = num.ToString();
}
}
}