gameplay所有基本功能都装了,加入了全局警告。加入飘字等各种东西。
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class load_skillwarn : MonoBehaviour
|
||||
{
|
||||
public static load_skillwarn Instance;
|
||||
|
||||
public GameObject skill_warn_prefab;
|
||||
public GameObject skillwarn_obj;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public void ShowWarning(string targetName, string attributeName)
|
||||
{
|
||||
if (skill_warn_prefab == null || skillwarn_obj == null) return;
|
||||
|
||||
var go = Instantiate(skill_warn_prefab, skillwarn_obj.transform, false);
|
||||
var comp = go.GetComponent<skillWarn_prefab>();
|
||||
if (comp != null)
|
||||
{
|
||||
if (comp.warn_btm_img != null && comp.warn_btm_red != null)
|
||||
comp.warn_btm_img.sprite = comp.warn_btm_red;
|
||||
|
||||
if (comp.warn_txt != null)
|
||||
comp.warn_txt.text = $"<b>{targetName}</b> 的 <b>{attributeName}</b> 已达到阈值";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user