(client) feat:实现血条显示,实现攻击交互,添加碰撞体;fix:修复部分朝向贴图加载失败的问题;chore:规范工作类和行为获取类命名
This commit is contained in:
18
Client/Assets/Scripts/Prefab/ProgressBarPrefab.cs
Normal file
18
Client/Assets/Scripts/Prefab/ProgressBarPrefab.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class ProgressBarPrefab:MonoBehaviour
|
||||
{
|
||||
public GameObject _progress;
|
||||
public float Progress
|
||||
{
|
||||
get => _progress.transform.localScale.x;
|
||||
set
|
||||
{
|
||||
var x=Mathf.Clamp01(value);
|
||||
_progress.transform.localScale = new Vector3(x, _progress.transform.localScale.y, _progress.transform.localScale.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user