导入【UGUI HUD Text v1.4.1.unitypackage】插件
将HUD预制物拖到项目中
扣血效果的代码
//参数:1、角色本身的transform,2、hp和-号组合
HUDTextInfo info7 = new HUDTextInfo(角色.transform, string.Format("{1}{0}", 血量, "-"));
info7.Color = Color.red;//颜色
info7.Size = UnityEngine.Random.Range(50, 120);//字体大小
info7.Speed = UnityEngine.Random.Range(0.2f, 1);
info7.VerticalAceleration = UnityEngine.Random.Range(-2, 2f);
info7.VerticalPositionOffset = 2f;
info7.VerticalFactorScale = UnityEngine.Random.Range(1.2f, 10);
info7.Side