Project_WL/Assets/Script/UI/Common/TopMoney.cs

27 lines
479 B
C#

using System.Collections;
using UnityEngine;
public class TopMoney : MonoBehaviourSingletonTemplate<TopMoney>
{
public MoneyForm[] moneys; // 0 젬, 1 골드
private void OnEnable()
{
StartCoroutine(Co_Update());
}
IEnumerator Co_Update()
{
while (true)
{
Set();
yield return new WaitForSeconds(1f);
}
}
public void Set()
{
moneys[0].Set(1);
moneys[1].Set(2);
}
}