|
|
@@ -38,13 +38,18 @@ public class MoveCharacter : Character
|
|
|
|
|
|
private float curTime; //漂浮已进行时长
|
|
|
private float height; //漂浮高度
|
|
|
- private float riseTime; //上升时间
|
|
|
+ private float riseTime; //上升时间
|
|
|
private float curHeight; //当前所在高度
|
|
|
private float rotateSpeed; //旋转速度
|
|
|
private float rotateDir; //旋转方向
|
|
|
private float backSpeed; //往后退的速度
|
|
|
+ public bool isFloat; //正在漂浮中
|
|
|
|
|
|
- private Vector3 origPos; //初始位置
|
|
|
+ public float normalFallSpeed;
|
|
|
+ public float rapidFallSpeed;
|
|
|
+ private float curFallSpeed;
|
|
|
+
|
|
|
+ private Vector3 origPos; //初始位置
|
|
|
private float origY;
|
|
|
private float pastTime; //上升已用时间
|
|
|
private float rise = 1;
|
|
|
@@ -96,6 +101,7 @@ public class MoveCharacter : Character
|
|
|
playerMesh = mesh;
|
|
|
playerMats = mats;
|
|
|
playerOut = outlineMats;
|
|
|
+ curFallSpeed = normalFallSpeed;
|
|
|
}
|
|
|
|
|
|
private void ChangeMat(int state)
|
|
|
@@ -120,6 +126,7 @@ public class MoveCharacter : Character
|
|
|
{
|
|
|
if (canMove)
|
|
|
{
|
|
|
+ isFloat = true;
|
|
|
ChangeMat(0);
|
|
|
curTime = 0;
|
|
|
if (floatState == 0)
|
|
|
@@ -142,6 +149,13 @@ public class MoveCharacter : Character
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void FloatDrop()
|
|
|
+ {
|
|
|
+ ChangeState(CharacterState.Fall);
|
|
|
+ floatState = 3;
|
|
|
+ curFallSpeed = rapidFallSpeed;
|
|
|
+ }
|
|
|
+
|
|
|
private void RotateSelf()
|
|
|
{
|
|
|
transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
@@ -182,7 +196,7 @@ public class MoveCharacter : Character
|
|
|
aniCollider.Play("Fall", 0, 0);
|
|
|
if (transform.position.y >= origY + 0.05f)
|
|
|
{
|
|
|
- curHeight -= 10 * Time.deltaTime;
|
|
|
+ curHeight -= curFallSpeed * Time.deltaTime;
|
|
|
transform.position = new Vector3(origPos.x, curHeight, origPos.z);
|
|
|
}
|
|
|
else if (foot.TrigGround || curHeight <= origY + 0.05f)
|
|
|
@@ -194,6 +208,8 @@ public class MoveCharacter : Character
|
|
|
{
|
|
|
m.SetInt("_Outline", 0);
|
|
|
floatState = 0;
|
|
|
+ isFloat = false;
|
|
|
+ curFallSpeed = normalFallSpeed;
|
|
|
if (gameObject.tag == "Player")
|
|
|
{
|
|
|
GetComponent<PlayerController>().soulCollector.enabled = true;
|