|
@@ -12,8 +12,6 @@ public class Demonic : MoveCharacter
|
|
|
public int id;
|
|
public int id;
|
|
|
public float costMp = 10;
|
|
public float costMp = 10;
|
|
|
public bool isBack = false; //往反方向走
|
|
public bool isBack = false; //往反方向走
|
|
|
- public float flyHeight;
|
|
|
|
|
- public float flyUpSpeed = 10;
|
|
|
|
|
public int baseSortingOrder;
|
|
public int baseSortingOrder;
|
|
|
int sortingOrder = 0;
|
|
int sortingOrder = 0;
|
|
|
public float runSpeed;
|
|
public float runSpeed;
|
|
@@ -45,12 +43,6 @@ public class Demonic : MoveCharacter
|
|
|
public int dropSoulMax = 3;
|
|
public int dropSoulMax = 3;
|
|
|
public int dropSoulMin = 1;
|
|
public int dropSoulMin = 1;
|
|
|
public float dropSoulAngle = 60f;
|
|
public float dropSoulAngle = 60f;
|
|
|
-
|
|
|
|
|
- [Header("验证功能开关")]
|
|
|
|
|
- public bool upFirstAfterWeaknessOrNot; //虚弱结束后是否先升高
|
|
|
|
|
-
|
|
|
|
|
- public bool isBeBlownUp; //被击飞
|
|
|
|
|
-
|
|
|
|
|
private void Start()
|
|
private void Start()
|
|
|
{
|
|
{
|
|
|
if (needToChange)
|
|
if (needToChange)
|
|
@@ -255,28 +247,6 @@ public class Demonic : MoveCharacter
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public override bool AdjustHeight()
|
|
|
|
|
- {
|
|
|
|
|
- if (canFly)
|
|
|
|
|
- {
|
|
|
|
|
- if (transform.position.y - flyHeight > 0.1f)
|
|
|
|
|
- {
|
|
|
|
|
- Vector3 pos = transform.position;
|
|
|
|
|
- pos.y -= flyUpSpeed * Time.deltaTime;
|
|
|
|
|
- transform.position = pos;
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- else if (transform.position.y - flyHeight < -0.1f)
|
|
|
|
|
- {
|
|
|
|
|
- Vector3 pos = transform.position;
|
|
|
|
|
- pos.y += flyUpSpeed * Time.deltaTime;
|
|
|
|
|
- transform.position = pos;
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public override void OnState()
|
|
public override void OnState()
|
|
|
{
|
|
{
|
|
|
base.OnState();
|
|
base.OnState();
|
|
@@ -314,16 +284,7 @@ public class Demonic : MoveCharacter
|
|
|
ChangeState(CharacterState.Run);
|
|
ChangeState(CharacterState.Run);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (!upFirstAfterWeaknessOrNot)
|
|
|
|
|
- {
|
|
|
|
|
- if (canFly)
|
|
|
|
|
- {
|
|
|
|
|
- rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
|
|
|
|
|
- rb.useGravity = false;
|
|
|
|
|
- AdjustHeight();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ AdjustHeight();
|
|
|
rb.velocity = Vector3.right * velocityAddition;
|
|
rb.velocity = Vector3.right * velocityAddition;
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Run:
|
|
case CharacterState.Run:
|
|
@@ -376,15 +337,7 @@ public class Demonic : MoveCharacter
|
|
|
Turn();
|
|
Turn();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (!upFirstAfterWeaknessOrNot)
|
|
|
|
|
- {
|
|
|
|
|
- if (canFly)
|
|
|
|
|
- {
|
|
|
|
|
- rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
|
|
|
|
|
- rb.useGravity = false;
|
|
|
|
|
- AdjustHeight();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ AdjustHeight();
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Rush:
|
|
case CharacterState.Rush:
|
|
|
if (isAttack)
|
|
if (isAttack)
|
|
@@ -436,7 +389,6 @@ public class Demonic : MoveCharacter
|
|
|
Turn();
|
|
Turn();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //AdjustHeight();
|
|
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Rise:
|
|
case CharacterState.Rise:
|
|
|
if (rb.velocity.y <= 0)
|
|
if (rb.velocity.y <= 0)
|