|
|
@@ -111,6 +111,10 @@ public class PlayerController : MoveCharacter
|
|
|
|
|
|
public Vector2 moveVec; //玩家不动时移动数据
|
|
|
|
|
|
+ public float relieveTranTime; //解除变身所需长按时间
|
|
|
+ private bool isTryingToRelieve = false;
|
|
|
+ private float pressTime;
|
|
|
+
|
|
|
public bool btnJumpPress
|
|
|
{
|
|
|
get
|
|
|
@@ -351,6 +355,16 @@ public class PlayerController : MoveCharacter
|
|
|
if (isTransfiguration)
|
|
|
{
|
|
|
bodyTrans.position = spiritObj.transform.position;
|
|
|
+ if (isTryingToRelieve)
|
|
|
+ {
|
|
|
+ pressTime += Time.deltaTime;
|
|
|
+ if (pressTime >= relieveTranTime)
|
|
|
+ {
|
|
|
+ EndTransfiguration(endChange);
|
|
|
+ isTryingToRelieve = false;
|
|
|
+ pressTime = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -446,23 +460,71 @@ public class PlayerController : MoveCharacter
|
|
|
}
|
|
|
void OnSummonSpirit()
|
|
|
{
|
|
|
- if (!isFloat && canMove)
|
|
|
+ if (!isTransfiguration && !isFloat && canMove)
|
|
|
isSpiritSummon = true;
|
|
|
+ if(isTransfiguration && currentSpirit == 0)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ void OnSummonSpiritUp()
|
|
|
+ {
|
|
|
+ if (isTryingToRelieve && currentSpirit == 0)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = false;
|
|
|
+ pressTime = 0;
|
|
|
+ }
|
|
|
}
|
|
|
void OnSummonSpirit1()
|
|
|
{
|
|
|
- if (!isFloat && canMove)
|
|
|
+ if (!isTransfiguration && !isFloat && canMove)
|
|
|
isSpiritSummon1 = true;
|
|
|
+ if (isTransfiguration && currentSpirit == 1)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ void OnSummonSpirit1Up()
|
|
|
+ {
|
|
|
+ if (isTryingToRelieve && currentSpirit == 1)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = false;
|
|
|
+ pressTime = 0;
|
|
|
+ }
|
|
|
}
|
|
|
void OnSummonSpirit2()
|
|
|
{
|
|
|
- if (!isFloat && canMove)
|
|
|
+ if (!isTransfiguration && !isFloat && canMove)
|
|
|
isSpiritSummon2 = true;
|
|
|
+ if (isTransfiguration && currentSpirit == 2)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ void OnSummonSpirit2Up()
|
|
|
+ {
|
|
|
+ if (isTryingToRelieve && currentSpirit == 2)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = false;
|
|
|
+ pressTime = 0;
|
|
|
+ }
|
|
|
}
|
|
|
void OnSummonSpirit3()
|
|
|
{
|
|
|
- if (!isFloat && canMove)
|
|
|
+ if (!isTransfiguration && !isFloat && canMove)
|
|
|
isSpiritSummon3 = true;
|
|
|
+ if (isTransfiguration && currentSpirit == 3)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ void OnSummonSpirit3Up()
|
|
|
+ {
|
|
|
+ if (isTryingToRelieve && currentSpirit == 3)
|
|
|
+ {
|
|
|
+ isTryingToRelieve = false;
|
|
|
+ pressTime = 0;
|
|
|
+ }
|
|
|
}
|
|
|
public void Jump()
|
|
|
{
|
|
|
@@ -1403,6 +1465,7 @@ public class PlayerController : MoveCharacter
|
|
|
{
|
|
|
playerSoulCollector = soulCollector;
|
|
|
id = id - 3;
|
|
|
+ currentSpirit = id;
|
|
|
if (id >= changePrefabs.Count)
|
|
|
{
|
|
|
Debug.LogError("未配置" + id + "号变身");
|