|
@@ -125,6 +125,7 @@ public class PlayerController : MoveCharacter
|
|
|
public float cacheSummonTime; //无法召唤时按下召唤键不会召唤,手感不好,缓存几帧,在这几帧内落地会立即召唤;
|
|
public float cacheSummonTime; //无法召唤时按下召唤键不会召唤,手感不好,缓存几帧,在这几帧内落地会立即召唤;
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
public int cacheSummonId;
|
|
public int cacheSummonId;
|
|
|
|
|
+ public float cacheDir; //召唤的时候按左右召唤结束不会响应手感不好,缓存一下,召唤后摇期间有左右响应的话会转向
|
|
|
|
|
|
|
|
[Header("召唤使魔")]
|
|
[Header("召唤使魔")]
|
|
|
public List<GameObject> demonicPrefabs;
|
|
public List<GameObject> demonicPrefabs;
|
|
@@ -1152,7 +1153,10 @@ public class PlayerController : MoveCharacter
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
rb.velocity = Vector3.right * velocityAddition;
|
|
rb.velocity = Vector3.right * velocityAddition;
|
|
|
-
|
|
|
|
|
|
|
+ if (leftDir.x > 0.3f || leftDir.x < -0.3f)
|
|
|
|
|
+ {
|
|
|
|
|
+ cacheDir = leftDir.x;
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Rush:
|
|
case CharacterState.Rush:
|
|
|
if (rushTime <= 0)
|
|
if (rushTime <= 0)
|
|
@@ -1461,6 +1465,18 @@ public class PlayerController : MoveCharacter
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Summon:
|
|
case CharacterState.Summon:
|
|
|
rb.isKinematic = false;
|
|
rb.isKinematic = false;
|
|
|
|
|
+ if(cacheDir != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cacheDir > 0.3f && bodyTrans.localScale.x > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Turn();
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cacheDir < -0.3f && bodyTrans.localScale.x < 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Turn();
|
|
|
|
|
+ }
|
|
|
|
|
+ cacheDir = 0;
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Transfiguration:
|
|
case CharacterState.Transfiguration:
|
|
|
rb.isKinematic = false;
|
|
rb.isKinematic = false;
|
|
@@ -1539,6 +1555,7 @@ public class PlayerController : MoveCharacter
|
|
|
ani.Play("summon", 0, 0);
|
|
ani.Play("summon", 0, 0);
|
|
|
velocity = Vector3.right * velocityAddition;
|
|
velocity = Vector3.right * velocityAddition;
|
|
|
rb.isKinematic = true;
|
|
rb.isKinematic = true;
|
|
|
|
|
+ cacheDir = 0;
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Transfiguration:
|
|
case CharacterState.Transfiguration:
|
|
|
aniCollider.Play("Transfiguration", 0, 0);
|
|
aniCollider.Play("Transfiguration", 0, 0);
|