|
|
@@ -43,6 +43,8 @@ public class AttributeStatus : MonoBehaviour
|
|
|
|
|
|
[TabGroup("击飞击落")] [DisplayOnly] public int hitState;
|
|
|
[TabGroup("击飞击落")] [DisplayOnly] public bool isFly;
|
|
|
+ [TabGroup("击飞击落")] [DisplayOnly] public int jumpNum;
|
|
|
+ [TabGroup("击飞击落")] [LabelText("弹跳力比例")] public float jumpNumRate;
|
|
|
[TabGroup("击飞击落")] [LabelText("X方向阻力")] public float decelerationRatioX = 2f;
|
|
|
[TabGroup("击飞击落")] [LabelText("Y方向重力")] public float decelerationRatioY = 15f;
|
|
|
public Character landingDamageFrom;
|
|
|
@@ -58,6 +60,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
[Tooltip("x为向下压缩经过的时间,y为回弹经过的时间")]
|
|
|
[TabGroup("击飞击落")] [LabelText("压缩速度")] public Vector2 compressionSpeed = new Vector2(0.2f, 0.4f);
|
|
|
[TabGroup("击飞击落")] [LabelText("弹跳速度")] public float jumpVel = 5f;
|
|
|
+ [TabGroup("击飞击落")] private Vector3 flyForce;
|
|
|
|
|
|
[TabGroup("易伤")]
|
|
|
[DisplayOnly] public bool haveVulnerable = false;
|
|
|
@@ -319,16 +322,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
if (!foot.haveGravity)
|
|
|
{
|
|
|
character.transform.position = new Vector3(transform.position.x, character.platformPosY, transform.position.z);
|
|
|
-
|
|
|
}
|
|
|
- character.ani.Play(AnimatorHash.ANIMATOR_weak, 0, 0);
|
|
|
- character.bodyCollider.layer = character.gameObject.layer;
|
|
|
- vel = vel / 5f;
|
|
|
- vel.y = jumpVel;
|
|
|
- character.mecanim.transform.localPosition = Vector3.zero;
|
|
|
- character.mecanim.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
|
|
- character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, character.platformRotZ);
|
|
|
- hitState = 1;
|
|
|
int landingDamage;
|
|
|
if (specialState == SpecialState.BlownUp)
|
|
|
{
|
|
|
@@ -354,6 +348,24 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ jumpNum--;
|
|
|
+ if (jumpNum < 0)
|
|
|
+ {
|
|
|
+ vel = vel / 5f;
|
|
|
+ vel.y = jumpVel;
|
|
|
+ character.mecanim.transform.localPosition = Vector3.zero;
|
|
|
+ character.mecanim.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
|
|
+ character.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, character.platformRotZ);
|
|
|
+ character.ani.Play(AnimatorHash.ANIMATOR_weak, 0, 0);
|
|
|
+ character.bodyCollider.layer = character.gameObject.layer;
|
|
|
+ hitState = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ flyForce *= jumpNumRate;
|
|
|
+ rb.AddForce(flyForce, ForceMode.Impulse);
|
|
|
+
|
|
|
+ }
|
|
|
BounceEffect();
|
|
|
}
|
|
|
else
|
|
|
@@ -534,8 +546,9 @@ public class AttributeStatus : MonoBehaviour
|
|
|
rb.useGravity = true;
|
|
|
rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
|
|
|
rb.velocity = Vector3.zero;
|
|
|
-
|
|
|
- rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
|
|
|
+ flyForce = vec3 * blowUp.force * (1 - resistances.BlowUp);
|
|
|
+ rb.AddForce(flyForce, ForceMode.Impulse);
|
|
|
+
|
|
|
rb.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
character.mecanim.transform.RotateAround(
|
|
|
character.transform.position + rotateCenterHeight * Vector3.up,
|
|
|
@@ -545,6 +558,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
startFlyPos = transform.position;
|
|
|
hitState = 0;
|
|
|
isFly = false;
|
|
|
+ jumpNum = blowUp.jumpNum;
|
|
|
character.ani.Play("hitted", 0, 0);
|
|
|
}
|
|
|
|