|
|
@@ -2,11 +2,23 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
|
|
|
+public enum Trans_AssassinState
|
|
|
+{
|
|
|
+ Normal = 0,
|
|
|
+ Ready = 1,
|
|
|
+
|
|
|
+}
|
|
|
public class Trans_Assassin : MonoBehaviour
|
|
|
{
|
|
|
public PlayerController player;
|
|
|
public float criticalChance; //±©»÷ÂÊ
|
|
|
public float criticalMultiplier; //±©»÷±¶Êý
|
|
|
+ public bool isUltimate;
|
|
|
+ public float distance;
|
|
|
+ public float rushSpeed;
|
|
|
+ public float rushTime;
|
|
|
+ public GameObject aimEffect;
|
|
|
+
|
|
|
// Start is called before the first frame update
|
|
|
void Start()
|
|
|
{
|
|
|
@@ -14,12 +26,25 @@ public class Trans_Assassin : MonoBehaviour
|
|
|
player.jumpNumber = 3;
|
|
|
player.criticalChance = criticalChance;
|
|
|
player.criticalMultiplier = criticalMultiplier;
|
|
|
+ distance = rushSpeed * rushTime * Time.deltaTime;
|
|
|
}
|
|
|
|
|
|
// Update is called once per frame
|
|
|
void Update()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
+ if (isUltimate)
|
|
|
+ {
|
|
|
+ ReadyToDash(player.moveVec);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (player.isUltimate)
|
|
|
+ {
|
|
|
+ isUltimate = true;
|
|
|
+ player.canMove = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
void Skill()
|
|
|
{
|
|
|
@@ -30,4 +55,32 @@ public class Trans_Assassin : MonoBehaviour
|
|
|
player.criticalChance = 0;
|
|
|
|
|
|
}
|
|
|
+ public void ReadyToDash(Vector2 leftDir)
|
|
|
+ {
|
|
|
+ Vector3 targetDir = leftDir.normalized;
|
|
|
+ aimEffect.transform.localScale =
|
|
|
+ new Vector3(distance, 1, 1);
|
|
|
+ float k = Mathf.Atan2(targetDir.y, targetDir.x) * Mathf.Rad2Deg;
|
|
|
+ if (targetDir.x < 0)
|
|
|
+ {
|
|
|
+ aimEffect.transform.rotation = Quaternion.Euler(new Vector3(0, 0, k));
|
|
|
+ if (player.bodyTrans.localScale.x < 0)
|
|
|
+ {
|
|
|
+ player.bodyTrans.localScale =
|
|
|
+ new Vector3(-player.bodyTrans.localScale.x,player.bodyTrans.localScale.y,
|
|
|
+ player.bodyTrans.localScale.z);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ aimEffect.transform.rotation = Quaternion.Euler(new Vector3(0, 0, k));
|
|
|
+ if (player.bodyTrans.localScale.x > 0)
|
|
|
+ {
|
|
|
+ player.bodyTrans.localScale =
|
|
|
+ new Vector3(-player.bodyTrans.localScale.x,player.bodyTrans.localScale.y,
|
|
|
+ player.bodyTrans.localScale.z);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|