Merge branch 'main' of https://gitea.deprived.dev/Sveskejuice/fgm24
This commit is contained in:
commit
793733b81a
|
@ -66,9 +66,34 @@ MonoBehaviour:
|
||||||
ropeExtendSpeed: 10
|
ropeExtendSpeed: 10
|
||||||
ropeShrinkSpeed: 15
|
ropeShrinkSpeed: 15
|
||||||
squezeDamage: 1
|
squezeDamage: 1
|
||||||
|
swingSpeedToDamageMultiplier:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 1
|
||||||
|
inSlope: 0.39527363
|
||||||
|
outSlope: 0.39527363
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0.04244307
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 30
|
||||||
|
value: 5
|
||||||
|
inSlope: 0.01896792
|
||||||
|
outSlope: 0.01896792
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.066252515
|
||||||
|
outWeight: 0
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
ropeMaxLength: 50
|
ropeMaxLength: 50
|
||||||
ropeMinLength: 20
|
ropeMinLength: 20
|
||||||
lineRenderer: {fileID: 901761791259710742}
|
lineRenderer: {fileID: 901761791259710742}
|
||||||
|
pullAnimationOvershootThreshold: 0.2
|
||||||
--- !u!120 &901761791259710742
|
--- !u!120 &901761791259710742
|
||||||
LineRenderer:
|
LineRenderer:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class RopeSimulator : MonoBehaviour
|
||||||
public float ropeExtendSpeed, ropeShrinkSpeed;
|
public float ropeExtendSpeed, ropeShrinkSpeed;
|
||||||
|
|
||||||
public float squezeDamage = 1f;
|
public float squezeDamage = 1f;
|
||||||
|
public AnimationCurve swingSpeedToDamageMultiplier;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
public float ropeMaxLength, ropeMinLength;
|
public float ropeMaxLength, ropeMinLength;
|
||||||
|
@ -68,6 +69,7 @@ public class RopeSimulator : MonoBehaviour
|
||||||
int[] order;
|
int[] order;
|
||||||
|
|
||||||
public float Overshoot => rope.CalculateLengthOvershoot();
|
public float Overshoot => rope.CalculateLengthOvershoot();
|
||||||
|
public bool InSwingMode => start.locked || end.locked;
|
||||||
|
|
||||||
public Rope rope;
|
public Rope rope;
|
||||||
|
|
||||||
|
@ -295,7 +297,9 @@ public class RopeSimulator : MonoBehaviour
|
||||||
|
|
||||||
if (squezeDamageReceiver == null) continue;
|
if (squezeDamageReceiver == null) continue;
|
||||||
|
|
||||||
squezeDamageReceiver.TakeSquezeDamage(collider.Value * squezeDamage);
|
|
||||||
|
float swingMultiplier = InSwingMode ? swingSpeedToDamageMultiplier.Evaluate((start.locked ? end : start).body.velocity.magnitude) : 1f;
|
||||||
|
squezeDamageReceiver.TakeSquezeDamage(collider.Value * squezeDamage * swingMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update line renderer
|
// Update line renderer
|
||||||
|
|
Loading…
Reference in New Issue