42 lines
914 B
C#
42 lines
914 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 int maxAmount;
|
|
private void Start()
|
|
{
|
|
GunInfo info = GameManager.Ins.GunInfos[launcher.type][1];
|
|
if(info==null)
|
|
return;
|
|
maxAmount = info.BulletAmount;
|
|
//gunName.text=info.CN_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+"/"+maxAmount;
|
|
}
|
|
if (launcher.curUserTime > 0)
|
|
{
|
|
gunAmount.text = ((int)launcher.curUserTime).ToString();
|
|
}
|
|
|
|
}
|
|
}
|