39 lines
832 B
C#
39 lines
832 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class GunUI : MonoBehaviour
|
|
{
|
|
public Launcher launcher;
|
|
|
|
public TMP_Text gunAmount;
|
|
public TMP_Text gunName;
|
|
|
|
private void Start()
|
|
{
|
|
GunInfo info = GameManager.Ins.GunInfos[launcher.type][1];
|
|
gunName.text=info.Name;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if(launcher==null)
|
|
return;
|
|
if (launcher.bullet_amount <= 0)
|
|
{
|
|
gunAmount.text = "充能中...";
|
|
}
|
|
if (launcher.bullet_amount > 0)
|
|
{
|
|
gunAmount.text= ((int)launcher.bullet_amount).ToString();
|
|
}
|
|
if (launcher.curUserTime > 0)
|
|
{
|
|
gunAmount.text = ((int)launcher.curUserTime).ToString();
|
|
}
|
|
|
|
}
|
|
}
|