|
@@ -46,6 +46,9 @@ public class AttributeStatus : MonoBehaviour
|
|
|
[TabGroup("击飞击落")] [LabelText("Y方向阻力")] public float decelerationRatioY = 15f;
|
|
[TabGroup("击飞击落")] [LabelText("Y方向阻力")] public float decelerationRatioY = 15f;
|
|
|
private Character landingDamageFrom;
|
|
private Character landingDamageFrom;
|
|
|
private Vector3 startFlyPos;
|
|
private Vector3 startFlyPos;
|
|
|
|
|
+ [TabGroup("击飞击落")] [LabelText("起飞预设角度")] public float startFlyAngle = 15f;
|
|
|
|
|
+ [TabGroup("击飞击落")] [LabelText("飞行预设角速度随机范围")] public Vector2 flyingRotateSpeedRange = new Vector2(15,45);
|
|
|
|
|
+ private float flyingRotateSpeed;
|
|
|
|
|
|
|
|
[TabGroup("易伤")]
|
|
[TabGroup("易伤")]
|
|
|
[DisplayOnly] public bool haveVulnerable;
|
|
[DisplayOnly] public bool haveVulnerable;
|
|
@@ -334,6 +337,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
vel.x += decelerationRatioX * Time.deltaTime;
|
|
vel.x += decelerationRatioX * Time.deltaTime;
|
|
|
}
|
|
}
|
|
|
vel.y -= decelerationRatioY * Time.deltaTime;
|
|
vel.y -= decelerationRatioY * Time.deltaTime;
|
|
|
|
|
+ rb.transform.Rotate(0,0, flyingRotateSpeed*Time.deltaTime);
|
|
|
isFly = true;
|
|
isFly = true;
|
|
|
}
|
|
}
|
|
|
rb.velocity = vel;
|
|
rb.velocity = vel;
|
|
@@ -447,18 +451,15 @@ public class AttributeStatus : MonoBehaviour
|
|
|
attackDir = attackFrom.position.x < transform.position.x ? -1 : 1;
|
|
attackDir = attackFrom.position.x < transform.position.x ? -1 : 1;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (attackDir < 0)
|
|
|
|
|
- {
|
|
|
|
|
- vec3.x = -vec3.x;
|
|
|
|
|
- }
|
|
|
|
|
hitState = -1;
|
|
hitState = -1;
|
|
|
character.ChangeState(CharacterState.SpecialStatus_BlowUp);
|
|
character.ChangeState(CharacterState.SpecialStatus_BlowUp);
|
|
|
character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
|
|
character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
|
|
|
rb.useGravity = true;
|
|
rb.useGravity = true;
|
|
|
rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
|
|
rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
|
|
|
rb.velocity = Vector3.zero;
|
|
rb.velocity = Vector3.zero;
|
|
|
- rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
|
|
|
|
|
- rb.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
|
|
|
+ rb.AddForce(vec3 * attackDir * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
|
|
|
|
|
+ rb.transform.rotation = Quaternion.Euler(0, 0, startFlyAngle * attackDir);
|
|
|
|
|
+ flyingRotateSpeed = UnityEngine.Random.Range(flyingRotateSpeedRange.x,flyingRotateSpeedRange.y) * attackDir;
|
|
|
startFlyPos = transform.position;
|
|
startFlyPos = transform.position;
|
|
|
hitState = 0;
|
|
hitState = 0;
|
|
|
isFly = false;
|
|
isFly = false;
|