|
|
@@ -9,6 +9,8 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
[Title("ESpirits_Assassin属性")]
|
|
|
[Tooltip("X为锁定玩家次数Y为锁定肉盾次数")]
|
|
|
[LabelText("锁敌逻辑")] public Vector2 lockingLogic;
|
|
|
+ [LabelText("复活次数")] public int revivesNum;
|
|
|
+ [LabelText("复活范围")] public Vector2 revivesPos;
|
|
|
public bool targetIsPlayer;
|
|
|
public int lockingNum;
|
|
|
private PlayerController player;
|
|
|
@@ -22,6 +24,30 @@ public class ESpirits_KiteNinja : Enemy
|
|
|
ChooseLockingTarget();
|
|
|
}
|
|
|
|
|
|
+ public override void OnState()
|
|
|
+ {
|
|
|
+ switch (state)
|
|
|
+ {
|
|
|
+ case CharacterState.Die:
|
|
|
+ revivesNum--;
|
|
|
+ if (revivesNum < 0)
|
|
|
+ {
|
|
|
+ gameObject.SetActive(false);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Init();
|
|
|
+ transform.position += new Vector3(
|
|
|
+ Random.Range(-revivesPos.x, revivesPos.x),
|
|
|
+ Random.Range(-revivesPos.y, revivesPos.y),
|
|
|
+ 0);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ base.OnState();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public override void ChangeState(CharacterState newState)
|
|
|
{
|
|
|
switch (state)
|