|
@@ -117,6 +117,12 @@ public class Character : MonoBehaviour
|
|
|
//调试开关
|
|
//调试开关
|
|
|
[Header("debug攻击者")] public bool debugAttackFrom;
|
|
[Header("debug攻击者")] public bool debugAttackFrom;
|
|
|
|
|
|
|
|
|
|
+ [FoldoutGroup("伤害跳字")] [LabelText("起手式位置")] public Vector2 injuryNumPos_summon = new Vector2(0, 1);
|
|
|
|
|
+ [FoldoutGroup("伤害跳字")] [LabelText("起手式随机范围")] public Vector2 injuryNumRandom_summon = Vector2.one;
|
|
|
|
|
+ [FoldoutGroup("伤害跳字")] [LabelText("行军式位置")] public Vector2 injuryNumPos_march = new Vector2(0, 1);
|
|
|
|
|
+ [FoldoutGroup("伤害跳字")] [LabelText("行军式随机范围")] public Vector2 injuryNumRandom_march = Vector2.one * 2;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public virtual void Init()
|
|
public virtual void Init()
|
|
|
{
|
|
{
|
|
|
//确保组件不丢失
|
|
//确保组件不丢失
|
|
@@ -198,13 +204,21 @@ public class Character : MonoBehaviour
|
|
|
if (isBeHitBySummonAttack)
|
|
if (isBeHitBySummonAttack)
|
|
|
{
|
|
{
|
|
|
injuryNum = Instantiate(injuryNumTextSummon);
|
|
injuryNum = Instantiate(injuryNumTextSummon);
|
|
|
|
|
+ injuryNum.transform.position = new Vector3(
|
|
|
|
|
+ transform.position.x + injuryNumPos_summon.x + Random.Range(-injuryNumRandom_summon.x, injuryNumRandom_summon.x),
|
|
|
|
|
+ transform.position.y + injuryNumPos_summon.y + Random.Range(-injuryNumRandom_summon.y, injuryNumRandom_summon.y),
|
|
|
|
|
+ transform.position.z);
|
|
|
}
|
|
}
|
|
|
//不是起手式
|
|
//不是起手式
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
injuryNum = Instantiate(injuryNumText);
|
|
injuryNum = Instantiate(injuryNumText);
|
|
|
|
|
+ injuryNum.transform.position = new Vector3(
|
|
|
|
|
+ transform.position.x + injuryNumPos_summon.x + Random.Range(-injuryNumRandom_summon.x, injuryNumRandom_summon.x),
|
|
|
|
|
+ transform.position.y + injuryNumPos_summon.y + Random.Range(-injuryNumRandom_summon.y, injuryNumRandom_summon.y),
|
|
|
|
|
+ transform.position.z);
|
|
|
}
|
|
}
|
|
|
- injuryNum.transform.position = new Vector3(transform.position.x + Random.Range(-1f, 1f), transform.position.y + 1, transform.position.z);
|
|
|
|
|
|
|
+
|
|
|
TextMeshProUGUI text = injuryNum.GetComponentInChildren<TextMeshProUGUI>();
|
|
TextMeshProUGUI text = injuryNum.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
text.text = damage.ToString();
|
|
text.text = damage.ToString();
|
|
|
if (gameObject.CompareTag("Player"))
|
|
if (gameObject.CompareTag("Player"))
|