|
@@ -16,10 +16,9 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
Null = -1,
|
|
Null = -1,
|
|
|
Float = 0,
|
|
Float = 0,
|
|
|
- BlownUp = 1,
|
|
|
|
|
- ShotDown = 2,
|
|
|
|
|
|
|
+ ShotDown = 1,
|
|
|
|
|
+ BlownUp = 2,
|
|
|
Stun = 3,
|
|
Stun = 3,
|
|
|
- Weak = 3,
|
|
|
|
|
Coma = 4,
|
|
Coma = 4,
|
|
|
}
|
|
}
|
|
|
public List<SpecialState> curSpecialStates = new List<SpecialState> {SpecialState.Null}; //[0]存放控制类状态,没有则为SpecialState.Null,[1:]存放其他状态
|
|
public List<SpecialState> curSpecialStates = new List<SpecialState> {SpecialState.Null}; //[0]存放控制类状态,没有则为SpecialState.Null,[1:]存放其他状态
|
|
@@ -63,7 +62,12 @@ public class AttributeStatus : MonoBehaviour
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
//眩晕状态
|
|
//眩晕状态
|
|
|
- if(strikeStunTime > 0)
|
|
|
|
|
|
|
+ if (strikeStunTime <= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ curSpecialStates[0] = SpecialState.Null;
|
|
|
|
|
+ character.ChangeState(CharacterState.Idle);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
rb.velocity = Vector3.zero;
|
|
rb.velocity = Vector3.zero;
|
|
|
strikeStunTime -= Time.deltaTime;
|
|
strikeStunTime -= Time.deltaTime;
|
|
@@ -97,6 +101,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
rb.useGravity = false;
|
|
rb.useGravity = false;
|
|
|
if (character.AdjustHeight())
|
|
if (character.AdjustHeight())
|
|
|
{
|
|
{
|
|
|
|
|
+ curSpecialStates[0] = SpecialState.Null;
|
|
|
character.ChangeState(CharacterState.Idle);
|
|
character.ChangeState(CharacterState.Idle);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -109,7 +114,12 @@ public class AttributeStatus : MonoBehaviour
|
|
|
break;
|
|
break;
|
|
|
//眩晕
|
|
//眩晕
|
|
|
case SpecialState.Stun:
|
|
case SpecialState.Stun:
|
|
|
- if (strikeStunTime > 0)
|
|
|
|
|
|
|
+ if (strikeStunTime <= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ curSpecialStates[0] = SpecialState.Null;
|
|
|
|
|
+ character.ChangeState(CharacterState.Idle);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
rb.velocity = Vector3.zero;
|
|
rb.velocity = Vector3.zero;
|
|
|
strikeStunTime -= Time.deltaTime;
|
|
strikeStunTime -= Time.deltaTime;
|
|
@@ -123,6 +133,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
if (rb.useGravity)
|
|
if (rb.useGravity)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(curSpecialStates[0]!=SpecialState.Null && curSpecialStates[0] < SpecialState.BlownUp)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
strikeStunTime = blowUp.time;
|
|
strikeStunTime = blowUp.time;
|
|
|
Vector3 vec3 = blowUp.dir.normalized;
|
|
Vector3 vec3 = blowUp.dir.normalized;
|
|
|
if(dir < 0)
|
|
if(dir < 0)
|
|
@@ -140,6 +154,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
if (!rb.useGravity)
|
|
if (!rb.useGravity)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (curSpecialStates[0] != SpecialState.Null && curSpecialStates[0] < SpecialState.ShotDown)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
strikeStunTime = shotDown.time;
|
|
strikeStunTime = shotDown.time;
|
|
|
Vector3 vec3 = shotDown.dir.normalized;
|
|
Vector3 vec3 = shotDown.dir.normalized;
|
|
|
if (dir < 0)
|
|
if (dir < 0)
|
|
@@ -157,6 +175,10 @@ public class AttributeStatus : MonoBehaviour
|
|
|
//受到击晕
|
|
//受到击晕
|
|
|
public void AddStun(AttackInfo.Stun stun)
|
|
public void AddStun(AttackInfo.Stun stun)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (curSpecialStates[0] != SpecialState.Null && curSpecialStates[0] < SpecialState.Stun)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
strikeStunTime = stun.time;
|
|
strikeStunTime = stun.time;
|
|
|
curSpecialStates[0] = SpecialState.Stun;
|
|
curSpecialStates[0] = SpecialState.Stun;
|
|
|
character.ChangeState(CharacterState.SpecialStatus);
|
|
character.ChangeState(CharacterState.SpecialStatus);
|