|
@@ -35,7 +35,7 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
public GameObject body;
|
|
public GameObject body;
|
|
|
public GameObject aim;
|
|
public GameObject aim;
|
|
|
public float aimDistance;
|
|
public float aimDistance;
|
|
|
- public Character character;
|
|
|
|
|
|
|
+ public Vector3 character;
|
|
|
private void Update()
|
|
private void Update()
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -44,9 +44,9 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
public void ReadyToDash(Vector3 pos0, Vector3 pos1)
|
|
public void ReadyToDash(Vector3 pos0, Vector3 pos1)
|
|
|
{
|
|
{
|
|
|
Vector3 target = (pos0 - pos1).normalized;
|
|
Vector3 target = (pos0 - pos1).normalized;
|
|
|
- float distance = time / readyCD * aimDistance;
|
|
|
|
|
- //float distance = aimDistance;
|
|
|
|
|
- aim.transform.position = pos1 + target * distance / 2;
|
|
|
|
|
|
|
+ //float distance = time / readyCD * aimDistance;
|
|
|
|
|
+ float distance = aimDistance;
|
|
|
|
|
+ //aim.transform.position = pos1 + target * distance / 2;
|
|
|
aim.transform.localScale =
|
|
aim.transform.localScale =
|
|
|
new Vector3(distance, 1, 1);
|
|
new Vector3(distance, 1, 1);
|
|
|
|
|
|
|
@@ -54,7 +54,7 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
float k = Mathf.Atan2(targetDir.y, targetDir.x) * Mathf.Rad2Deg;
|
|
float k = Mathf.Atan2(targetDir.y, targetDir.x) * Mathf.Rad2Deg;
|
|
|
if (targetDir.x < 0)
|
|
if (targetDir.x < 0)
|
|
|
{
|
|
{
|
|
|
- aim.transform.rotation = Quaternion.Euler(new Vector3(0, 0, k - 180));
|
|
|
|
|
|
|
+ aim.transform.rotation = Quaternion.Euler(new Vector3(0, 0, k));
|
|
|
body.transform.localScale = new Vector3(1, 1, 1);
|
|
body.transform.localScale = new Vector3(1, 1, 1);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -78,34 +78,34 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
enemy.searchState = SearchState.InSearchScope;
|
|
enemy.searchState = SearchState.InSearchScope;
|
|
|
enemy.ChangeState(CharacterState.Run);
|
|
enemy.ChangeState(CharacterState.Run);
|
|
|
|
|
|
|
|
- character = enemy.targetCharacter;
|
|
|
|
|
|
|
+
|
|
|
state = AssassinState.FindPlayer;
|
|
state = AssassinState.FindPlayer;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case AssassinState.FindPlayer:
|
|
case AssassinState.FindPlayer:
|
|
|
- if (Vector3.Distance(transform.position, character.transform.position)
|
|
|
|
|
|
|
+ if (Vector3.Distance(transform.position, enemy.targetCharacter.transform.position)
|
|
|
< hateDistance)
|
|
< hateDistance)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ character = enemy.targetCharacter.transform.position;
|
|
|
enemy.ChangeState(CharacterState.Rush);
|
|
enemy.ChangeState(CharacterState.Rush);
|
|
|
rb.velocity = Vector3.zero;
|
|
rb.velocity = Vector3.zero;
|
|
|
enemy.ani.Play("charge", 0, 0);
|
|
enemy.ani.Play("charge", 0, 0);
|
|
|
aim.SetActive(true);
|
|
aim.SetActive(true);
|
|
|
- aimDistance = dashTime * dashSpeed;
|
|
|
|
|
|
|
+ aimDistance = dashTime * dashSpeed/2;
|
|
|
state = AssassinState.ReadyToDash;
|
|
state = AssassinState.ReadyToDash;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case AssassinState.ReadyToDash:
|
|
case AssassinState.ReadyToDash:
|
|
|
time += Time.deltaTime;
|
|
time += Time.deltaTime;
|
|
|
- ReadyToDash(character.transform.position+Vector3.up,
|
|
|
|
|
- transform.position+Vector3.up);
|
|
|
|
|
|
|
+ ReadyToDash(character + Vector3.up,
|
|
|
|
|
+ transform.position + Vector3.up);
|
|
|
if (time >= readyCD)
|
|
if (time >= readyCD)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
dashEffect.isDash = true;
|
|
dashEffect.isDash = true;
|
|
|
dashEffect.isDashAttack = true;
|
|
dashEffect.isDashAttack = true;
|
|
|
targetDir =
|
|
targetDir =
|
|
|
- (character.transform.position - transform.position).normalized;
|
|
|
|
|
|
|
+ (character - transform.position).normalized;
|
|
|
enemy.ani.Play("attack_summon", 0, 0);
|
|
enemy.ani.Play("attack_summon", 0, 0);
|
|
|
aim.SetActive(false);
|
|
aim.SetActive(false);
|
|
|
aim.transform.localScale = Vector3.one;
|
|
aim.transform.localScale = Vector3.one;
|
|
@@ -152,7 +152,7 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
break;
|
|
break;
|
|
|
case AssassinState.Down:
|
|
case AssassinState.Down:
|
|
|
|
|
|
|
|
- if (transform.position.y < 1)
|
|
|
|
|
|
|
+ if (transform.position.y < 0)
|
|
|
{
|
|
{
|
|
|
enemy.ani.Play("fall_end", 0, 0);
|
|
enemy.ani.Play("fall_end", 0, 0);
|
|
|
|
|
|
|
@@ -161,8 +161,9 @@ public class ESpirits_Assassin : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
Dash();
|
|
Dash();
|
|
|
}
|
|
}
|
|
|
- if (enemy.foot.TrigGround)
|
|
|
|
|
|
|
+ if (enemy.foot.TrigGround|| transform.position.y < -1)
|
|
|
{
|
|
{
|
|
|
|
|
+ transform.position = new Vector3(transform.position.x, -1, 0);
|
|
|
body.transform.rotation = Quaternion.Euler(Vector3.zero);
|
|
body.transform.rotation = Quaternion.Euler(Vector3.zero);
|
|
|
state = AssassinState.Finish;
|
|
state = AssassinState.Finish;
|
|
|
|
|
|