fixes in dash and autotargetting after testing on the device

This commit is contained in:
2025-05-19 13:54:25 +02:00
parent 247f3e8050
commit cf0e8e0723
10 changed files with 2040 additions and 2176 deletions

View File

@@ -974,10 +974,6 @@ PrefabInstance:
type: 3}
insertIndex: -1
addedObject: {fileID: 2376798499169876625}
- targetCorrespondingSourceObject: {fileID: 5661303424784160307, guid: 3545b719df392a940ac2b114c933a71f,
type: 3}
insertIndex: -1
addedObject: {fileID: 2725179368898716889}
m_SourcePrefab: {fileID: 100100000, guid: 3545b719df392a940ac2b114c933a71f, type: 3}
--- !u!1 &145182807891766407 stripped
GameObject:
@@ -997,6 +993,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 312629d966d1a40e3874daa93364e1f3, type: 3}
m_Name:
m_EditorClassIdentifier:
targetIcon: {fileID: 0}
--- !u!114 &498122787460346701
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -1122,86 +1119,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 8306974481074663877}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4456505617813006326 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5661303424784160307, guid: 3545b719df392a940ac2b114c933a71f,
type: 3}
m_PrefabInstance: {fileID: 8306974481074663877}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2725179368898716889
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4456505617813006326}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c9981c8680e1592459742cdeaae0dc53, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Mode: 1
m_MinDist: 2
m_MaxDist: 8.4
m_ShotTime: 4
m_FadeTime: 1
m_curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0.007072786
outSlope: 0.007072786
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0.1323849
- serializedVersion: 3
time: 4.5461073
value: 0.030068476
inSlope: 0.0033217394
outSlope: 0.28578714
tangentMode: 1
weightedMode: 0
inWeight: 0.5712558
outWeight: 0.33333334
- serializedVersion: 3
time: 6.9705496
value: 1.0026509
inSlope: 0.05356809
outSlope: 0.024359979
tangentMode: 1
weightedMode: 0
inWeight: 0.16454618
outWeight: 0.042083014
- serializedVersion: 3
time: 10.313543
value: 0.03776002
inSlope: 0.00019160505
outSlope: 0.00019160505
tangentMode: 0
weightedMode: 0
inWeight: 0.16120066
outWeight: 0.10344152
- serializedVersion: 3
time: 14.553565
value: -0.000000144355
inSlope: 5.535649e-11
outSlope: 5.535649e-11
tangentMode: 0
weightedMode: 0
inWeight: 0.11561939
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_tagObject: {fileID: 0}
m_outlineable: {fileID: 0}
m_useFresnel: 1
m_fresnelColor: {r: 1, g: 0.08701121, b: 0, a: 1}
m_fresnelPower: 12
m_fresnelIntensity: 0.7
--- !u!137 &6170306833334748310 stripped
SkinnedMeshRenderer:
m_CorrespondingSourceObject: {fileID: 2803798737370346835, guid: 3545b719df392a940ac2b114c933a71f,

View File

@@ -106505,6 +106505,7 @@ MonoBehaviour:
animClipName: MagicPush
m_selectedType: 1
currentSelectedSpellName:
enableAutoTargetIntegration: 1
maxTurnTowardDistance: 10
rotationSpeed: 500
degreeThreshold: 100

View File

@@ -318,17 +318,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1107 &-8648560938890334150
AnimatorStateMachine:
serializedVersion: 6
@@ -444,17 +443,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &-8482761997087685909
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -735,18 +733,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.3
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: 0.33
attackTimeScaleEnd: 0.37
maxTargetDistance: 3
maxTurnTowardDistance: 10
lowHealthTh: 10
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 500
degreeThreshold: 100
debug: 0
--- !u!1101 &-8051095333111886674
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -1625,17 +1621,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &-6392689329446905468
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1661,17 +1656,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &-6373209660523634493
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1729,17 +1723,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &-6322121412971540966
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -1765,17 +1758,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1101 &-6289689196406086201
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -2487,18 +2479,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.3
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 30
attackTimeScale: 0.1
attackTimeScaleStart: 0.4
attackTimeScaleEnd: 0.5
maxTargetDistance: 3
maxTurnTowardDistance: 10
lowHealthTh: 30
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 500
degreeThreshold: 100
debug: 0
--- !u!114 &-4859208400828985047
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -2734,17 +2724,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1102 &-4527595170684018172
AnimatorState:
serializedVersion: 6
@@ -4543,18 +4532,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.3
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 10
attackTimeScale: 0.1
attackTimeScaleStart: 0.2
attackTimeScaleEnd: 0.3
maxTargetDistance: 3
maxTurnTowardDistance: 10
lowHealthTh: 10
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 500
degreeThreshold: 100
debug: 0
--- !u!114 &-1270803735202051326
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -4997,18 +4984,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
maxTurnTowardDistance: 6
lowHealthTh: 10
degreeThreshold: 15
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
degreeThreshold: 15
debug: 0
--- !u!114 &-670023210091854233
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -5833,17 +5818,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11404640
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -5953,17 +5937,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11424034
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -6200,17 +6183,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11468922
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -6236,17 +6218,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11476414
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -6318,17 +6299,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11483756
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -6423,17 +6403,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &11487874
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -20789,17 +20768,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114000012058145300
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -20983,17 +20961,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114173081088732178
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21052,17 +21029,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114204451307792824
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21107,17 +21083,16 @@ MonoBehaviour:
activeRagdoll: 1
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114231790030935560
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21225,17 +21200,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114296478714166974
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21532,17 +21506,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114446205462832556
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21602,17 +21575,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114480230802912944
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21811,17 +21783,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114608773870077618
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21847,17 +21818,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114610283087860218
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -21943,17 +21913,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &114633244054452058
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -25603,17 +25572,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1102 &309218042155430426
AnimatorState:
serializedVersion: 6
@@ -25700,18 +25668,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.6
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 35
attackTimeScale: 0.2
attackTimeScaleStart: 0.28
attackTimeScaleEnd: 0.58
maxTargetDistance: 3
maxTurnTowardDistance: 10
lowHealthTh: 35
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 500
degreeThreshold: 100
debug: 0
--- !u!1101 &542493047717198179
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -25905,17 +25871,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1109 &896748119524214651
AnimatorTransition:
m_ObjectHideFlags: 1
@@ -45008,17 +44973,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &3562439251465149028
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -46624,18 +46588,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 10
attackTimeScale: 0.3
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
maxTurnTowardDistance: 6
lowHealthTh: 10
degreeThreshold: 100
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
degreeThreshold: 100
debug: 0
--- !u!1102 &6206484485940957156
AnimatorState:
serializedVersion: 6
@@ -46772,18 +46734,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 1
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
maxTargetDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
maxTurnTowardDistance: 6
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
degreeThreshold: 20
debug: 0
--- !u!206 &6539530510086331788
BlendTree:
m_ObjectHideFlags: 1
@@ -47065,17 +47025,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 0.2
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!114 &6975622290643910291
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -47134,17 +47093,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 0
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1101 &7084117839568741563
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -47797,17 +47755,16 @@ MonoBehaviour:
activeRagdoll: 0
senselessTime: 0
resetAttackTrigger: 0
debug: 0
useAttackTimeScale: 0
resetTriggerBeforeTime: 0.5
useAttackTimeScale: 0
slowMoActivationDistance: 3
lowHealthTh: 10
attackTimeScale: 1
attackTimeScaleStart: -1
attackTimeScaleEnd: -1
maxTargetDistance: 3
lowHealthTh: 10
degreeThreshold: 20
rotatePlayerTowardsTarget: 1
rotationSpeed: 5
rotationActivationAngle: 45
debug: 0
--- !u!1109 &8069668193388962134
AnimatorTransition:
m_ObjectHideFlags: 1

View File

@@ -18988,12 +18988,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b8fd6dab0eb7c40d59fd6631516b3b51, type: 3}
m_Name:
m_EditorClassIdentifier:
maxTargetingDistance: 5
maxTargetingDistance: 7
targetingInterval: 0.25
targetingAngleThreshold: 90
playerRotationSpeed: 10
materialHighlightPropertyName: _FresnelColor
highlightColor: {r: 10.680627, g: 0.19149402, b: 0, a: 2}
highlightColor: {r: 10.680627, g: 1.0696704, b: 0, a: 2}
deselectHighlightColor: {r: 0, g: 0, b: 0, a: 1}
highlightFadeDuration: 0.3
preferSkinnedMeshRenderer: 1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -159,7 +159,7 @@ namespace Beyond
public float CurrentHealth => m_vController.currentHealth;
public float MaxHealth => m_vController.MaxHealth;
public AutoTargetting AutoTarget { get; internal set; }
public AutoTargetting AutoTarget => m_autoTargetting;
private AutoTargetting m_autoTargetting;
private void Awake()

View File

@@ -249,11 +249,11 @@ namespace Beyond
if (m_prevState == State.COMBAT)
{
m_thirdPersonInput.ResetCameraState();
SetDefaultInputsForRollJump();
//SetDefaultInputsForRollJump();
}
else if (state == State.COMBAT)
{
SetRollInputOnJump();
//SetRollInputOnJump();
m_thirdPersonInput.ChangeCameraState(m_cameraCombatState, true);
}
}
@@ -281,7 +281,7 @@ namespace Beyond
m_state = state;
m_OnStateChanged?.Invoke(m_state);
}
/*
private void SetRollInputOnJump()
{
m_thirdPersonInput.rollInput = m_jumpInput;
@@ -293,7 +293,7 @@ namespace Beyond
m_thirdPersonInput.rollInput = m_rollInput;
m_thirdPersonInput.jumpInput = m_jumpInput;
}
*/
public void OnCombat(vFSMBehaviourController combatController)
{
if (m_combatControllers.Count == 0)

View File

@@ -1,312 +1,287 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Beyond;
using Invector.vCharacterController.AI;
using Invector.vCharacterController.AI.FSMBehaviour;
using Beyond; // For Player, GameStateManager, TimeController
using Invector.vCharacterController.AI.FSMBehaviour; // For vFSMBehaviourController
using UnityEngine;
namespace Invector.vMelee
{
using vEventSystems;
using vEventSystems; // For vIAttackListener
public class bMeleeAttackControl : StateMachineBehaviour
{
[Tooltip("normalizedTime of Active Damage")]
[Header("Damage Window")]
[Tooltip("NormalizedTime of Active Damage")]
public float startDamage = 0.05f;
[Tooltip("normalizedTime of Disable Damage")]
[Tooltip("NormalizedTime of Disable Damage")]
public float endDamage = 0.9f;
[Header("Attack Properties")]
public int damageMultiplier;
public int recoilID;
public int reactionID;
public vAttackType meleeAttackType = vAttackType.Unarmed;
[Tooltip("You can use a name as reference to trigger a custom HitDamageParticle")]
public string damageType;
[HideInInspector] [Header("This work with vMeleeManager to active vMeleeAttackObject from bodyPart and id")]
[Tooltip("Body parts to activate for damage detection.")]
public List<string> bodyParts = new List<string> { "RightLowerArm" };
[Header("Hit Effects")]
public bool ignoreDefense;
public bool activeRagdoll;
[vHideInInspector("activeRagdoll"), Tooltip("Time to keep Ragdoll active")]
[vHideInInspector("activeRagdoll")]
[Tooltip("Time to keep Ragdoll active if activeRagdoll is true.")]
public float senselessTime;
[Tooltip("Check true in the last attack of your combo to reset the triggers")]
[Header("Attack Flow")]
[Tooltip("Check true in the last attack of your combo to reset the FSM attack triggers.")]
public bool resetAttackTrigger;
private bool isActive;
public bool debug;
private vIAttackListener mFighter;
private bool isAttacking;
//private bool slowMoActive = false;
public bool useAttackTimeScale = false;
[Tooltip("Normalized time point to reset attack triggers if resetAttackTrigger is true.")]
public float resetTriggerBeforeTime = 0.5f;
public float attackTimeScale = 0.2f;
public float attackTimeScaleStart = -1f;
public float attackTimeScaleEnd = -1f;
public float maxTargetDistance = 3f;
public float maxTurnTowardDistance = 6f;
[Header("Slow Motion Settings")]
[Tooltip("Enable slow motion effect during this attack based on conditions below.")]
public bool useAttackTimeScale = false;
[Tooltip("Distance within which the current auto-target must be for slow motion to consider activating. Analogous to slowMoActivationDistance in vMeleeAttackControl.")]
public float maxTargetDistance = 3f; // This will be used as slowMoActivationDistance
[Tooltip("Target health threshold below which slow motion might activate (if near).")]
public float lowHealthTh = 10f;
private bool m_hasScaledTime = false;
public float degreeThreshold = 20;
[Tooltip("Time scale to apply during slow motion.")]
public float attackTimeScale = 0.2f;
[Tooltip("Normalized time to start the slow motion window. If < 0, uses 'startDamage'.")]
public float attackTimeScaleStart = -1f;
[Tooltip("Normalized time to end the slow motion window. If < 0, uses 'endDamage'.")]
public float attackTimeScaleEnd = -1f;
[Header("Rotation Settings")]
[Tooltip("If true, the character will attempt to rotate towards the auto-target during this attack state.")]
public bool rotatePlayerTowardsTarget;
private bool m_isRotating;
public float rotationSpeed = 30f;
[Tooltip("The angle (in degrees from player's forward) within which the auto-target must be for rotation to engage. Analogous to rotationActivationAngle in vMeleeAttackControl.")]
public float degreeThreshold = 20f; // This will be used as rotationActivationAngle
// rotationSpeed field is now unused, AutoTargetting.playerRotationSpeed will be used.
// maxTurnTowardDistance field is now unused.
[Header("Debug")]
public bool debug;
// Private state variables
private bool isActive; // Is damage window active
private vIAttackListener mFighter;
private bool isAttacking; // Is this attack state logic considered "attacking"
private bool m_hasScaledTime; // Has slow motion been activated in this instance of the state
private AutoTargetting _autoTargettingInstance;
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
mFighter = animator.GetComponent<vIAttackListener>();
if (Player.Instance != null)
{
_autoTargettingInstance = Player.Instance.AutoTarget;
}
if (_autoTargettingInstance == null && debug)
{
Debug.LogWarning($"({damageType}) AutoTargetting instance not found via Player.Instance.AutoTarget on {animator.name}. Rotation and target-dependent slow-mo will be limited.");
}
isAttacking = true;
//slowMoActive = false;
isActive = false;
m_hasScaledTime = false;
if (mFighter != null)
mFighter.OnEnableAttack();
if (debug)
Debug.Log("Enter " + damageType);
Debug.Log($"({damageType}) OnStateEnter: {animator.name}, Layer: {layerIndex}");
if (attackTimeScaleStart < 0f)
{
attackTimeScaleStart = startDamage;
}
if (attackTimeScaleEnd < 0f)
{
attackTimeScaleEnd = endDamage;
}
}
private void LerpRotation()
{
if (!rotatePlayerTowardsTarget)
{
return;
}
float minDist = maxTurnTowardDistance;
var enemy = GetNearestEnemy(ref minDist);
if (!IsEnemyInAngleRange(enemy))
{
return;
}
Transform playerTransform = Player.Instance.transform;
var toEnemy = enemy.transform.position - playerTransform.position;
toEnemy.y = 0f;
toEnemy.Normalize();
Quaternion targetRot =
Quaternion.LookRotation(toEnemy);
var rotation = playerTransform.rotation;
rotation = Quaternion.RotateTowards(rotation, targetRot, Time.deltaTime * rotationSpeed);
//rotation = Quaternion.Lerp(rotation, targetRot, Time.deltaTime * rotationSpeed);
playerTransform.rotation = rotation;
}
private bool IsEnemyInAngleRange(vFSMBehaviourController ai)
{
if (ai == null)
{
return false;
}
Vector3 playerFwd = Player.Instance.transform.forward;
Vector3 target = (ai.transform.forward - playerFwd).normalized;
float dot = Vector3.Dot(playerFwd, target );
float angle = 180f - Mathf.Acos(dot) * Mathf.Rad2Deg;
//Debug.Log("IsEnemyInAngleRange: angle: "+angle);
if (angle > degreeThreshold)
{
return false;
}
return true;
}
public float NearTargertHealth()
{
float health = -1f;
if (Player.Instance.LockOn.currentTarget != null)
{
var aic = Player.Instance.LockOn.currentTarget.GetComponent<vControlAICombat>();
if (aic != null)
{
health = aic.currentHealth;
return health;
}
}
float minDist = Single.PositiveInfinity;
var ctrl = GetNearestEnemy(ref minDist);
if (minDist < maxTargetDistance)
{
health = ctrl.aiController.currentHealth;
}
return health;
}
private bool NearHealthLow()
{
float h = NearTargertHealth();
return h > 0f && h < lowHealthTh;
}
private vFSMBehaviourController GetNearestEnemy(ref float minDist)
{
var controllers = GameStateManager.Instance.GetActiveCombatcontrollers();
Vector3 playerPos = Player.Instance.transform.position;
vFSMBehaviourController ctrl = null;
foreach (var aic in controllers)
{
var dist2 = aic.transform.position - Player.Instance.transform.position;
dist2.y = 0f;
if (dist2.magnitude < minDist)
{
ctrl = aic;
minDist = dist2.magnitude;
}
}
return ctrl;
}
public bool TargetNear()
{
var targets = Player.Instance.LockOn.GetNearbyTargets();
if (targets.Count == 0)
return false;
else
{
var dist2 = targets[0].position - Player.Instance.transform.position;
dist2.y = 0f;
return dist2.magnitude < maxTargetDistance;
}
}
private void UpdateSlowMo(float normalizedTime)
{
if (!m_hasScaledTime)
{
if (normalizedTime >= attackTimeScaleStart && normalizedTime <= attackTimeScaleEnd)
{
if (TargetNear() && (useAttackTimeScale || NearHealthLow()))
{
TimeController.Instance.SetTimeScaleForSec(attackTimeScale, attackTimeScaleEnd - normalizedTime, true);
//Time.timeScale = attackTimeScale;
m_hasScaledTime = true;
}
}
} else if (normalizedTime > attackTimeScaleEnd)
{
m_hasScaledTime = false;
}
if (attackTimeScaleStart < 0f) attackTimeScaleStart = startDamage;
if (attackTimeScaleEnd < 0f) attackTimeScaleEnd = endDamage;
}
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (Player.Instance.ActiveWeaponTrail)
if (Player.Instance.ActiveWeaponTrail) // Existing weapon trail logic
{
Player.Instance.ActiveWeaponTrail.m_colorMultiplier = Color.white +Color.red * damageMultiplier;
Player.Instance.ActiveWeaponTrail.m_colorMultiplier = Color.white + Color.red * damageMultiplier;
}
float nTime = stateInfo.normalizedTime % 1;
float currentNormalizedTime = stateInfo.normalizedTime % 1;
if (currentNormalizedTime == 0 && stateInfo.normalizedTime > 0.5f) currentNormalizedTime = 1f;
LerpRotation();
// --- ROTATION LOGIC ---
AttemptRotationTowardsAutoTarget(animator);
if (nTime >= startDamage && nTime <= endDamage && !isActive)
// --- SLOW MOTION LOGIC ---
if (useAttackTimeScale)
{
if (debug)
Debug.Log(animator.name + " attack " + damageType + " enable damage in " +
System.Math.Round(stateInfo.normalizedTime % 1, 2));
UpdateSlowMotion(animator, stateInfo, currentNormalizedTime);
}
// --- DAMAGE WINDOW LOGIC ---
if (!isActive && currentNormalizedTime >= startDamage && currentNormalizedTime <= endDamage)
{
if (debug) Debug.Log($"({damageType}) Enable Damage: normTime={currentNormalizedTime:F2} (Start:{startDamage:F2}, End:{endDamage:F2})");
isActive = true;
ActiveDamage(animator, true);
/*
if (TargetNear() && (useAttackTimeScale || NearHealthLow()))
{
TimeController.Instance.SetTimeScaleForSec(attackTimeScale, endDamage - nTime);
//Time.timeScale = attackTimeScale;
m_hasScaledTime = true;
}
*/
}
else if (nTime > endDamage && isActive)
else if (isActive && currentNormalizedTime > endDamage)
{
if (debug)
Debug.Log(animator.name + " attack " + damageType + " disable damage in " +
System.Math.Round(stateInfo.normalizedTime % 1, 2));
if (debug) Debug.Log($"({damageType}) Disable Damage: normTime={currentNormalizedTime:F2} > {endDamage:F2}");
isActive = false;
ActiveDamage(animator, false);
if (m_hasScaledTime)
// Note: Original bMeleeAttackControl reset m_hasScaledTime here.
// vMeleeAttackControl resets it if currentNormalizedTime > attackTimeScaleEnd.
// TimeController handles restoring time, so m_hasScaledTime is more about preventing re-triggering within one state.
// It's reset in UpdateSlowMotion or OnStateExit.
}
// --- ATTACK STATE AND TRIGGER RESET LOGIC ---
if (isAttacking)
{
if (currentNormalizedTime > endDamage)
{
//Time.timeScale = 1f;
m_hasScaledTime = false;
if (mFighter != null) mFighter.OnDisableAttack();
isAttacking = false;
if (debug) Debug.Log($"({damageType}) OnDisableAttack called: normTime={currentNormalizedTime:F2}");
}
// Original bMelee had: "if (nTime > .1f && nTime < resetTriggerBeforeTime && isAttacking)"
// vMelee has: "else if (resetAttackTrigger && currentNormalizedTime >= resetTriggerBeforeTime)"
// Adopting vMelee's more standard approach for early reset:
else if (resetAttackTrigger && currentNormalizedTime >= resetTriggerBeforeTime)
{
if (mFighter != null) mFighter.ResetAttackTriggers();
if (debug) Debug.Log($"({damageType}) ResetAttackTriggers called: normTime={currentNormalizedTime:F2}");
// To prevent multiple calls, ideally ResetAttackTriggers is idempotent or use a flag.
// For now, matching vMelee's potential for multiple calls if time hovers.
}
}
if (nTime > endDamage && isAttacking)
{
isAttacking = false;
if (mFighter != null)
mFighter.OnDisableAttack();
}
if (nTime > .1f && nTime < resetTriggerBeforeTime && isAttacking)
{
if (mFighter != null)
mFighter.ResetAttackTriggers();
}
//if (stateInfo.normalizedTime % 1 > allowRotationAt && isAttacking)
//{
// isAttacking = false;
// if (mFighter != null)
// mFighter.OnDisableAttack();
//}
UpdateSlowMo(nTime);
}
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (debug)
Debug.Log("Exit " + damageType);
if (debug) Debug.Log($"({damageType}) OnStateExit: {animator.name}");
if (isActive)
{
isActive = false;
ActiveDamage(animator, false);
if (debug) Debug.Log($"({damageType}) Damage disabled on StateExit.");
}
if (isAttacking)
if (isAttacking && mFighter != null)
{
isAttacking = false;
if (mFighter != null)
mFighter.OnDisableAttack();
mFighter.OnDisableAttack();
if (debug) Debug.Log($"({damageType}) OnDisableAttack called on StateExit (fallback).");
}
isAttacking = false;
m_hasScaledTime = false; // Reset slow motion flag
if (mFighter != null && resetAttackTrigger) // Final reset if configured
{
mFighter.ResetAttackTriggers();
if (debug) Debug.Log($"({damageType}) ResetAttackTriggers called on StateExit due to resetAttackTrigger flag.");
}
}
private void AttemptRotationTowardsAutoTarget(Animator animator)
{
if (!rotatePlayerTowardsTarget || _autoTargettingInstance == null || _autoTargettingInstance.CurrentTarget == null)
{
return;
}
if (mFighter != null && resetAttackTrigger)
mFighter.ResetAttackTriggers();
// Using bMeleeAttackControl's degreeThreshold as the activation angle
if (_autoTargettingInstance.IsTargetInAngle(animator.transform, _autoTargettingInstance.CurrentTarget, degreeThreshold))
{
// AutoTargetting.playerRotationSpeed will be used internally by this call
_autoTargettingInstance.ExecuteRotationTowardsCurrentTarget(Time.deltaTime);
}
}
if (debug) Debug.Log(animator.name + " attack " + damageType + " stateExit");
private void UpdateSlowMotion(Animator animator, AnimatorStateInfo stateInfo, float currentNormalizedTime)
{
// This method is called only if useAttackTimeScale (field) is true.
if (_autoTargettingInstance == null || TimeController.Instance == null) return;
if (!m_hasScaledTime)
{
if (currentNormalizedTime >= attackTimeScaleStart && currentNormalizedTime <= attackTimeScaleEnd)
{
bool triggerSlowMo = false;
if (_autoTargettingInstance.CurrentTarget != null)
{
// Use bMeleeAttackControl's maxTargetDistance as the activation distance
float distSqr = (_autoTargettingInstance.CurrentTarget.transform.position - animator.transform.position).sqrMagnitude;
bool targetNear = distSqr <= maxTargetDistance * maxTargetDistance;
if (targetNear)
{
// Mimicking vMeleeAttackControl's effective logic:
// If useAttackTimeScale (field) is true (which it is to get here) and target is near, then trigger.
// The lowHealthTh can act as an additional, prioritized condition if desired,
// but with current structure, `this.useAttackTimeScale` being true makes the second part of OR true.
float currentTargetHealth = _autoTargettingInstance.GetCurrentTargetHealth();
bool targetHealthLow = currentTargetHealth > 0f && currentTargetHealth < lowHealthTh;
if (targetHealthLow) // Prioritize if health is low and near
{
triggerSlowMo = true;
}
// else if (this.useAttackTimeScale) // This refers to the field, which is true if we are in this function.
// So if target is Near, this path will be taken if not already low health.
// Simplified: if targetNear, triggerSlowMo = true because this.useAttackTimeScale is already true.
// The following `else if` is essentially `else if (true)`
else
{
triggerSlowMo = true; // General case: near and useAttackTimeScale is on
}
}
}
// else: No current target, so no target-dependent slow motion.
if (triggerSlowMo)
{
// Use vMeleeAttackControl's duration calculation for SetTimeScaleForSec
float slowMoEffectDuration = (attackTimeScaleEnd - currentNormalizedTime) * stateInfo.length;
if (slowMoEffectDuration > 0.01f) // Ensure a meaningful duration
{
// The 'true' for forceUnique in bMelee's original TimeController call.
// Assuming TimeController.Instance.SetTimeScaleForSec now handles this or has an overload.
// If SetTimeScaleForSec(scale, duration, bool forceUnique) exists:
// TimeController.Instance.SetTimeScaleForSec(attackTimeScale, slowMoEffectDuration, true);
// If not, use the existing TimeController method. For now, assuming vMelee's version:
TimeController.Instance.SetTimeScaleForSec(attackTimeScale, slowMoEffectDuration);
if (debug) Debug.Log($"({damageType}) Slow-mo ACTIVATED. Target: {_autoTargettingInstance.CurrentTarget?.name ?? "N/A"}. Duration: {slowMoEffectDuration:F2}s. NormTime: {currentNormalizedTime:F2}");
}
else if (debug) Debug.Log($"({damageType}) Slow-mo trigger met, but calculated duration too short ({slowMoEffectDuration:F2}s). NormTime: {currentNormalizedTime:F2}");
m_hasScaledTime = true;
}
}
}
else if (currentNormalizedTime > attackTimeScaleEnd && m_hasScaledTime) // If slow-mo was active and window has passed
{
m_hasScaledTime = false;
if (debug) Debug.Log($"({damageType}) Slow-mo window ended (normTime={currentNormalizedTime:F2}). m_hasScaledTime reset.");
// TimeController.Instance is responsible for restoring time scale.
}
}
void ActiveDamage(Animator animator, bool value)
{
var meleeManager = animator.GetComponent<vMeleeManager>();
if (meleeManager)
{
meleeManager.SetActiveAttack(bodyParts, meleeAttackType, value, damageMultiplier, recoilID, reactionID,
ignoreDefense, activeRagdoll, senselessTime, damageType);
}
else if(debug)
{
Debug.LogWarning($"({damageType}) vMeleeManager not found on {animator.name}. Cannot activate/deactivate damage.");
}
}
}
}

View File

@@ -65,11 +65,11 @@ Material:
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BlendOp: 0
- _BlendOp: 2
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1