您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
28 行
769 B
28 行
769 B
using MyUILibrary;
|
|
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace Unity.MegaCity.UI
|
|
{
|
|
/// <summary>
|
|
/// LaserBar UI element
|
|
/// </summary>
|
|
public class LaserBar : MonoBehaviour
|
|
{
|
|
private RadialProgress m_LaserBar;
|
|
|
|
private void Awake()
|
|
{
|
|
var root = GetComponent<UIDocument>().rootVisualElement;
|
|
var parent = root.Q<VisualElement>("crosshair");
|
|
var container = parent.Q<VisualElement>("laser-bar");
|
|
m_LaserBar = container.Q<RadialProgress>("radial-progress");
|
|
m_LaserBar.HideLabel();
|
|
}
|
|
public void UpdateBar(float energy)
|
|
{
|
|
m_LaserBar.progress = energy;
|
|
}
|
|
}
|
|
}
|