fix: Gravity changers working, gravity strength now in character properties
This commit is contained in:
parent
9e96946b1a
commit
8eca56c0fd
@ -13,13 +13,13 @@ MonoBehaviour:
|
||||
m_Name: DefaultPrefabObjects
|
||||
m_EditorClassIdentifier:
|
||||
_prefabs:
|
||||
- {fileID: 6141811525297683108, guid: abf4376f1c6f28241b1125c0eac87199, type: 3}
|
||||
- {fileID: 6527384552577148640, guid: 7b71eecaf6568a847b4b8415852f9e98, type: 3}
|
||||
- {fileID: 6696145061262954739, guid: 6bef8667f8847d440b83722af55e8d58, type: 3}
|
||||
- {fileID: 4320456058255827552, guid: 65cd4fa5e050652409dd9b062365c7e8, type: 3}
|
||||
- {fileID: 394654179909484550, guid: 9f3e27e33167d704e941e42ded557111, type: 3}
|
||||
- {fileID: 394654179909484550, guid: 5934082513feac04a9b875fc86abe70b, type: 3}
|
||||
- {fileID: 394654179909484550, guid: 46f84e56340e83e4ba7c6abbccd2ae3f, type: 3}
|
||||
- {fileID: 6141811525297683108, guid: abf4376f1c6f28241b1125c0eac87199, type: 3}
|
||||
- {fileID: 6527384552577148640, guid: 7b71eecaf6568a847b4b8415852f9e98, type: 3}
|
||||
- {fileID: 6696145061262954739, guid: 6bef8667f8847d440b83722af55e8d58, type: 3}
|
||||
- {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, type: 3}
|
||||
|
||||
@ -13,6 +13,7 @@ Material:
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _ALPHAPREMULTIPLY_ON
|
||||
- _ENVIRONMENTREFLECTIONS_OFF
|
||||
- _MANUAL_RIPPLE
|
||||
- _OCCLUSIONMAP
|
||||
- _SPECULARHIGHLIGHTS_OFF
|
||||
|
||||
@ -13,6 +13,7 @@ Material:
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _ALPHAPREMULTIPLY_ON
|
||||
- _ENVIRONMENTREFLECTIONS_OFF
|
||||
- _MANUAL_RIPPLE
|
||||
- _OCCLUSIONMAP
|
||||
- _SPECULARHIGHLIGHTS_OFF
|
||||
|
||||
@ -13,6 +13,7 @@ Material:
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _ALPHAPREMULTIPLY_ON
|
||||
- _ENVIRONMENTREFLECTIONS_OFF
|
||||
- _MANUAL_RIPPLE
|
||||
- _OCCLUSIONMAP
|
||||
- _SPECULARHIGHLIGHTS_OFF
|
||||
|
||||
@ -26,6 +26,7 @@ Material:
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _ALPHAPREMULTIPLY_ON
|
||||
- _ENVIRONMENTREFLECTIONS_OFF
|
||||
- _MANUAL_RIPPLE
|
||||
- _OCCLUSIONMAP
|
||||
- _SPECULARHIGHLIGHTS_OFF
|
||||
@ -129,7 +130,7 @@ Material:
|
||||
- _DstBlendAlpha: 10
|
||||
- _Emission: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _EnvironmentalReflections: 0
|
||||
- _EnvironmentalReflections: 1
|
||||
- _Frequency: 155
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
@ -142,7 +143,7 @@ Material:
|
||||
- _ManualRippleFrequency: 20
|
||||
- _ManualRippleRadius: 2.5
|
||||
- _MaxWaveDistortion: 1.13
|
||||
- _Metallic: 0.88
|
||||
- _Metallic: 0.406
|
||||
- _MetallicSpecGlossMapToggle: 0
|
||||
- _MetallicSpecToggle: 0
|
||||
- _NormalMapToggle: 0
|
||||
@ -151,7 +152,7 @@ Material:
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.906
|
||||
- _Smoothness: 1
|
||||
- _SmoothnessSource: 0
|
||||
- _SmoothnessTextureChannel: 1
|
||||
- _SpecularHighlights: 1
|
||||
@ -190,7 +191,7 @@ Material:
|
||||
- _ImpactOrigin: {r: 1, g: 0, b: 0, a: 0}
|
||||
- _ManualRippleOrigin: {r: 1, g: 0, b: 0, a: 0}
|
||||
- _ModelOrigin: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _SpecColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 1}
|
||||
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _WaveOrigin: {r: 1, g: 0, b: 0, a: 0}
|
||||
- _impact_origin: {r: 1, g: 0, b: 0, a: 1}
|
||||
- _rotation: {r: 0.1, g: 0, b: 0, a: 1}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9615c7fd8e252c145b562238bcfc1b23
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -32,6 +32,7 @@ Transform:
|
||||
m_LocalScale: {x: 3, y: 3, z: 3}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 4274613733215928132}
|
||||
- {fileID: 3847966118591952769}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -76,19 +77,20 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 42bb47879381c4f498a115b2b84b191a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
forcesManager: {fileID: 0}
|
||||
renderedZoneObject: {fileID: 3847966118592310179}
|
||||
ForcesManager: {fileID: 0}
|
||||
RenderedZoneObject: {fileID: 3847966118592310179}
|
||||
GravityEffect: {fileID: 2798249376021352391}
|
||||
GravityColors:
|
||||
- gravity: 0
|
||||
color: {r: 0.20188677, g: 1, b: 0.27700332, a: 0.27450982}
|
||||
color: {r: 0.20188677, g: 1, b: 0.27700332, a: 0.3529412}
|
||||
- gravity: 1
|
||||
color: {r: 0.81708485, g: 0.20943397, b: 1, a: 0.27450982}
|
||||
color: {r: 0.81708485, g: 0.20943397, b: 1, a: 0.3529412}
|
||||
- gravity: 2
|
||||
color: {r: 1, g: 0.2396226, b: 0.55570096, a: 0.27450982}
|
||||
color: {r: 1, g: 0.2396226, b: 0.55570096, a: 0.3529412}
|
||||
- gravity: 3
|
||||
color: {r: 0.25471687, g: 0.77203095, b: 1, a: 0.27450982}
|
||||
color: {r: 0.25471687, g: 0.77203095, b: 1, a: 0.3529412}
|
||||
- gravity: 4
|
||||
color: {r: 1, g: 0.4656382, b: 0.2471698, a: 0.27450982}
|
||||
color: {r: 1, g: 0.4656382, b: 0.2471698, a: 0.3529412}
|
||||
_gravity: 0
|
||||
--- !u!1001 &4147390443820438502
|
||||
PrefabInstance:
|
||||
@ -169,3 +171,158 @@ GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 930210402018179141, guid: 42641a1e05f4e084bae7d69b644dfd81, type: 3}
|
||||
m_PrefabInstance: {fileID: 4147390443820438502}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &7276724944824422886
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 5300185106086715317}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: lengthInSec
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.type
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: moveWithTransform
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.x.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.y.scalar
|
||||
value: -1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.z.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.m_Position.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.m_Position.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.m_Position.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.m_Rotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.radius.value
|
||||
value: 1.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: ShapeModule.radiusThickness
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.inWorldSpace
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.radial.scalar
|
||||
value: 0.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: InitialModule.maxNumParticles
|
||||
value: 80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.orbitalX.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.orbitalY.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.orbitalZ.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: InitialModule.startSpeed.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: EmissionModule.rateOverTime.scalar
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: InitialModule.startLifetime.scalar
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: VelocityModule.speedModifier.scalar
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5747506880537754056, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gravity Line Particles Sphere
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
--- !u!198 &2798249376021352391 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 4767480441459301921, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
m_PrefabInstance: {fileID: 7276724944824422886}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4274613733215928132 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6894558316197621410, guid: 9615c7fd8e252c145b562238bcfc1b23, type: 3}
|
||||
m_PrefabInstance: {fileID: 7276724944824422886}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
||||
@ -206,9 +206,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &1372816401649438144
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -341,17 +338,13 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2b6244fd2a6ceee4ab8504fadf75ae20, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 4320456058255827552}
|
||||
_networkObjectCache: {fileID: 4320456058255827552}
|
||||
props: {fileID: 11400000, guid: 046eba218bb1e8946bee79bd55fd4bdd, type: 2}
|
||||
boostUI: {fileID: 0}
|
||||
cameraOperator: {fileID: 0}
|
||||
boostEffect: {fileID: 7234768050496314884}
|
||||
gravityEffect: {fileID: 4872706334040053047}
|
||||
jetFlameEffect: {fileID: 4832079438170929303}
|
||||
smokeTrailEffect: {fileID: 3500843490324877803}
|
||||
fireController: {fileID: 6551228186126772357}
|
||||
Props: {fileID: 0}
|
||||
CameraOperator: {fileID: 0}
|
||||
BoostEffect: {fileID: 0}
|
||||
GravityEffect: {fileID: 0}
|
||||
JetFlameEffect: {fileID: 0}
|
||||
SmokeTrailEffect: {fileID: 0}
|
||||
BodyMeshRenderer: {fileID: 0}
|
||||
--- !u!114 &6551228186126772357
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -426,7 +419,6 @@ MonoBehaviour:
|
||||
<ComponentIndex>k__BackingField: 0
|
||||
<PredictedSpawn>k__BackingField: {fileID: 0}
|
||||
_networkBehaviours:
|
||||
- {fileID: 2704141135220834432}
|
||||
- {fileID: 7840113418566161560}
|
||||
<SerializedRootNetworkBehaviour>k__BackingField: {fileID: 0}
|
||||
<NestedRootNetworkBehaviours>k__BackingField: []
|
||||
@ -443,16 +435,21 @@ MonoBehaviour:
|
||||
_enablePrediction: 0
|
||||
_predictionType: 0
|
||||
_graphicalObject: {fileID: 0}
|
||||
_detachGraphicalObject: 0
|
||||
_enableStateForwarding: 1
|
||||
_networkTransform: {fileID: 0}
|
||||
_ownerInterpolation: 1
|
||||
_ownerSmoothedProperties: 255
|
||||
_adaptiveInterpolation: 3
|
||||
_spectatorSmoothedProperties: 255
|
||||
_spectatorInterpolation: 2
|
||||
_enableTeleport: 0
|
||||
_teleportThreshold: 1
|
||||
<PrefabId>k__BackingField: 5
|
||||
<PrefabId>k__BackingField: 9
|
||||
<SpawnableCollectionId>k__BackingField: 0
|
||||
_scenePathHash: 0
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 13364203004141276529
|
||||
<AssetPathHash>k__BackingField: 16354951339476624532
|
||||
--- !u!114 &7840113418566161560
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -465,7 +462,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 1
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 4320456058255827552}
|
||||
_networkObjectCache: {fileID: 4320456058255827552}
|
||||
_componentConfiguration: 0
|
||||
@ -567,9 +564,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &6980644068169889807
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -639,9 +633,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 0
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &7841776443744888956
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -752,11 +743,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
--- !u!198 &4872706334040053047 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 4767480441459301921, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
m_PrefabInstance: {fileID: 123332957444049686}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &6780256004419462580 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6894558316197621410, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
@ -835,11 +821,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
--- !u!198 &7234768050496314884 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 7931003585827073002, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 754241372986275310}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &7971143227516595385 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7271248515473135959, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
@ -1092,11 +1073,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3563661011899316502, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
m_PrefabInstance: {fileID: 2003113329371731864}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &4832079438170929303 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 6395817701140918031, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
m_PrefabInstance: {fileID: 2003113329371731864}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &3400143175839768829
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1154,11 +1130,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
--- !u!198 &3500843490324877803 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 2286353817893630230, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 3400143175839768829}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4542710706480618604 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1163423376577002641, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
@ -182,17 +182,13 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2b6244fd2a6ceee4ab8504fadf75ae20, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
props: {fileID: 11400000, guid: 8a085cd94fb766846992f4cbfd013aa7, type: 2}
|
||||
boostUI: {fileID: 0}
|
||||
cameraOperator: {fileID: 0}
|
||||
boostEffect: {fileID: 7760749495303355546}
|
||||
gravityEffect: {fileID: 8590080437221755141}
|
||||
jetFlameEffect: {fileID: 3312185522185408775}
|
||||
smokeTrailEffect: {fileID: 978131449706323191}
|
||||
fireController: {fileID: 0}
|
||||
Props: {fileID: 0}
|
||||
CameraOperator: {fileID: 0}
|
||||
BoostEffect: {fileID: 0}
|
||||
GravityEffect: {fileID: 0}
|
||||
JetFlameEffect: {fileID: 0}
|
||||
SmokeTrailEffect: {fileID: 0}
|
||||
BodyMeshRenderer: {fileID: 0}
|
||||
--- !u!114 &394654179909484550
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -209,7 +205,6 @@ MonoBehaviour:
|
||||
<ComponentIndex>k__BackingField: 0
|
||||
<PredictedSpawn>k__BackingField: {fileID: 0}
|
||||
_networkBehaviours:
|
||||
- {fileID: 2704141135220834432}
|
||||
- {fileID: 8307104301583811584}
|
||||
<SerializedRootNetworkBehaviour>k__BackingField: {fileID: 0}
|
||||
<NestedRootNetworkBehaviours>k__BackingField: []
|
||||
@ -226,16 +221,21 @@ MonoBehaviour:
|
||||
_enablePrediction: 0
|
||||
_predictionType: 0
|
||||
_graphicalObject: {fileID: 0}
|
||||
_detachGraphicalObject: 0
|
||||
_enableStateForwarding: 1
|
||||
_networkTransform: {fileID: 0}
|
||||
_ownerInterpolation: 1
|
||||
_ownerSmoothedProperties: 255
|
||||
_adaptiveInterpolation: 3
|
||||
_spectatorSmoothedProperties: 255
|
||||
_spectatorInterpolation: 2
|
||||
_enableTeleport: 0
|
||||
_teleportThreshold: 1
|
||||
<PrefabId>k__BackingField: 11
|
||||
<PrefabId>k__BackingField: 2
|
||||
<SpawnableCollectionId>k__BackingField: 0
|
||||
_scenePathHash: 0
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 5551583836262103703
|
||||
<AssetPathHash>k__BackingField: 2797995355616760398
|
||||
--- !u!114 &8307104301583811584
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -248,7 +248,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 1
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
_componentConfiguration: 0
|
||||
@ -403,9 +403,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &7931096401578265872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -475,9 +472,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &8148123273009086921
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -547,9 +541,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 0
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &9047713688665039503
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -665,11 +656,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7271248515473135959, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &7760749495303355546 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 7931003585827073002, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1308797000485596641
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -732,11 +718,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1163423376577002641, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &978131449706323191 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 2286353817893630230, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1578594390765257941
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -909,11 +890,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6894558316197621410, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
m_PrefabInstance: {fileID: 3827891006853830436}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &8590080437221755141 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 4767480441459301921, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
m_PrefabInstance: {fileID: 3827891006853830436}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8445865029439684104
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1335,11 +1311,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
--- !u!198 &3312185522185408775 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 6395817701140918031, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
m_PrefabInstance: {fileID: 8445865029439684104}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4918238313528133406 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3563661011899316502, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
@ -182,17 +182,13 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2b6244fd2a6ceee4ab8504fadf75ae20, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
props: {fileID: 11400000, guid: 38b05003293b5c24abcb9b8491dd5c45, type: 2}
|
||||
boostUI: {fileID: 0}
|
||||
cameraOperator: {fileID: 0}
|
||||
boostEffect: {fileID: 7760749495303355546}
|
||||
gravityEffect: {fileID: 2930093712651127642}
|
||||
jetFlameEffect: {fileID: 3312185522185408775}
|
||||
smokeTrailEffect: {fileID: 978131449706323191}
|
||||
fireController: {fileID: 0}
|
||||
Props: {fileID: 0}
|
||||
CameraOperator: {fileID: 0}
|
||||
BoostEffect: {fileID: 0}
|
||||
GravityEffect: {fileID: 0}
|
||||
JetFlameEffect: {fileID: 0}
|
||||
SmokeTrailEffect: {fileID: 0}
|
||||
BodyMeshRenderer: {fileID: 0}
|
||||
--- !u!114 &394654179909484550
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -209,7 +205,6 @@ MonoBehaviour:
|
||||
<ComponentIndex>k__BackingField: 0
|
||||
<PredictedSpawn>k__BackingField: {fileID: 0}
|
||||
_networkBehaviours:
|
||||
- {fileID: 2704141135220834432}
|
||||
- {fileID: 8307104301583811584}
|
||||
<SerializedRootNetworkBehaviour>k__BackingField: {fileID: 0}
|
||||
<NestedRootNetworkBehaviours>k__BackingField: []
|
||||
@ -226,16 +221,21 @@ MonoBehaviour:
|
||||
_enablePrediction: 0
|
||||
_predictionType: 0
|
||||
_graphicalObject: {fileID: 0}
|
||||
_detachGraphicalObject: 0
|
||||
_enableStateForwarding: 1
|
||||
_networkTransform: {fileID: 0}
|
||||
_ownerInterpolation: 1
|
||||
_ownerSmoothedProperties: 255
|
||||
_adaptiveInterpolation: 3
|
||||
_spectatorSmoothedProperties: 255
|
||||
_spectatorInterpolation: 2
|
||||
_enableTeleport: 0
|
||||
_teleportThreshold: 1
|
||||
<PrefabId>k__BackingField: 9
|
||||
<PrefabId>k__BackingField: 6
|
||||
<SpawnableCollectionId>k__BackingField: 0
|
||||
_scenePathHash: 0
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 10015891062238479949
|
||||
<AssetPathHash>k__BackingField: 6698779595108695616
|
||||
--- !u!114 &8307104301583811584
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -248,7 +248,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 1
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
_componentConfiguration: 0
|
||||
@ -403,9 +403,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &7931096401578265872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -475,9 +472,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &8148123273009086921
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -547,9 +541,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 0
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &9047713688665039503
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -665,11 +656,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7271248515473135959, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &7760749495303355546 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 7931003585827073002, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1308797000485596641
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -732,11 +718,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1163423376577002641, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &978131449706323191 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 2286353817893630230, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1578594390765257941
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -904,11 +885,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
--- !u!198 &2930093712651127642 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 4767480441459301921, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
m_PrefabInstance: {fileID: 7674334455437251963}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &3832232075009489881 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6894558316197621410, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
@ -1335,11 +1311,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
--- !u!198 &3312185522185408775 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 6395817701140918031, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
m_PrefabInstance: {fileID: 8445865029439684104}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4918238313528133406 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3563661011899316502, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
@ -182,17 +182,13 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2b6244fd2a6ceee4ab8504fadf75ae20, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
props: {fileID: 11400000, guid: 04ffb42925f036949866663c0311ac6b, type: 2}
|
||||
boostUI: {fileID: 0}
|
||||
cameraOperator: {fileID: 0}
|
||||
boostEffect: {fileID: 7760749495303355546}
|
||||
gravityEffect: {fileID: 5356225948148490788}
|
||||
jetFlameEffect: {fileID: 3312185522185408775}
|
||||
smokeTrailEffect: {fileID: 978131449706323191}
|
||||
fireController: {fileID: 0}
|
||||
Props: {fileID: 0}
|
||||
CameraOperator: {fileID: 0}
|
||||
BoostEffect: {fileID: 0}
|
||||
GravityEffect: {fileID: 0}
|
||||
JetFlameEffect: {fileID: 0}
|
||||
SmokeTrailEffect: {fileID: 0}
|
||||
BodyMeshRenderer: {fileID: 0}
|
||||
--- !u!114 &394654179909484550
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -209,7 +205,6 @@ MonoBehaviour:
|
||||
<ComponentIndex>k__BackingField: 0
|
||||
<PredictedSpawn>k__BackingField: {fileID: 0}
|
||||
_networkBehaviours:
|
||||
- {fileID: 2704141135220834432}
|
||||
- {fileID: 8307104301583811584}
|
||||
<SerializedRootNetworkBehaviour>k__BackingField: {fileID: 0}
|
||||
<NestedRootNetworkBehaviours>k__BackingField: []
|
||||
@ -226,16 +221,21 @@ MonoBehaviour:
|
||||
_enablePrediction: 0
|
||||
_predictionType: 0
|
||||
_graphicalObject: {fileID: 0}
|
||||
_detachGraphicalObject: 0
|
||||
_enableStateForwarding: 1
|
||||
_networkTransform: {fileID: 0}
|
||||
_ownerInterpolation: 1
|
||||
_ownerSmoothedProperties: 255
|
||||
_adaptiveInterpolation: 3
|
||||
_spectatorSmoothedProperties: 255
|
||||
_spectatorInterpolation: 2
|
||||
_enableTeleport: 0
|
||||
_teleportThreshold: 1
|
||||
<PrefabId>k__BackingField: 1
|
||||
<PrefabId>k__BackingField: 3
|
||||
<SpawnableCollectionId>k__BackingField: 0
|
||||
_scenePathHash: 0
|
||||
<SceneId>k__BackingField: 0
|
||||
<AssetPathHash>k__BackingField: 5851826624730448275
|
||||
<AssetPathHash>k__BackingField: 12197567711296960114
|
||||
--- !u!114 &8307104301583811584
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -248,7 +248,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_componentIndexCache: 1
|
||||
_componentIndexCache: 0
|
||||
_addedNetworkObject: {fileID: 394654179909484550}
|
||||
_networkObjectCache: {fileID: 394654179909484550}
|
||||
_componentConfiguration: 0
|
||||
@ -403,9 +403,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &7931096401578265872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -475,9 +472,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 1
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &8148123273009086921
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -547,9 +541,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tackleKind: 0
|
||||
TackleResponse:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &9047713688665039503
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -665,11 +656,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7271248515473135959, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &7760749495303355546 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 7931003585827073002, guid: 24a81306cc1fbbd4b8f10022e2d6ee0d, type: 3}
|
||||
m_PrefabInstance: {fileID: 406218082282592112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &611466096646765573
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -731,11 +717,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
--- !u!198 &5356225948148490788 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 4767480441459301921, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
m_PrefabInstance: {fileID: 611466096646765573}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &6328183573752812199 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6894558316197621410, guid: 5075d8b26bc537c439b56964f382020e, type: 3}
|
||||
@ -803,11 +784,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1163423376577002641, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!198 &978131449706323191 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 2286353817893630230, guid: 98bf6d3624da8d54fbe33787e003ef60, type: 3}
|
||||
m_PrefabInstance: {fileID: 1308797000485596641}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1578594390765257941
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1335,11 +1311,6 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
--- !u!198 &3312185522185408775 stripped
|
||||
ParticleSystem:
|
||||
m_CorrespondingSourceObject: {fileID: 6395817701140918031, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
m_PrefabInstance: {fileID: 8445865029439684104}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4918238313528133406 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3563661011899316502, guid: a85c082f5fc6ca4428f78f385e6b42a9, type: 3}
|
||||
@ -76,7 +76,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 456d6ebbd09c16d488cbe8451ae0e5f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
forcesManager: {fileID: 0}
|
||||
renderedZoneObject: {fileID: 5479003418548602625}
|
||||
NimbleZoneColors:
|
||||
- gravity: 0
|
||||
@ -84,11 +83,11 @@ MonoBehaviour:
|
||||
- gravity: 1
|
||||
color: {r: 0.81708485, g: 0.20943397, b: 1, a: 0.27450982}
|
||||
- gravity: 2
|
||||
color: {r: 1, g: 0.2396226, b: 0.55570096, a: 0.27450982}
|
||||
color: {r: 1, g: 0.2396226, b: 0.55570096, a: 0.54901963}
|
||||
- gravity: 3
|
||||
color: {r: 0.25471687, g: 0.77203095, b: 1, a: 0.27450982}
|
||||
color: {r: 0.25471687, g: 0.77203095, b: 1, a: 0.54901963}
|
||||
- gravity: 4
|
||||
color: {r: 1, g: 0.4656382, b: 0.2471698, a: 0.27450982}
|
||||
color: {r: 1, g: 0.4656382, b: 0.2471698, a: 0.54901963}
|
||||
outsideGravityFunction: 0
|
||||
zone: 0
|
||||
rippleFrequency: 12
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1020,6 +1020,10 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 592057803}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.y.scalar
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3680835022977216242, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gravity Changer (1)
|
||||
@ -1069,7 +1073,7 @@ PrefabInstance:
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: forcesManager
|
||||
propertyPath: ForcesManager
|
||||
value:
|
||||
objectReference: {fileID: 1659830376}
|
||||
m_RemovedComponents: []
|
||||
@ -1495,6 +1499,18 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 592057803}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.y.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: InitialModule.startSpeed.scalar
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.speedModifier.scalar
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3680835022977216242, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gravity Changer (4)
|
||||
@ -1541,10 +1557,10 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: _gravity
|
||||
value: 2
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: forcesManager
|
||||
propertyPath: ForcesManager
|
||||
value:
|
||||
objectReference: {fileID: 1659830376}
|
||||
m_RemovedComponents: []
|
||||
@ -4775,7 +4791,7 @@ PrefabInstance:
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: forcesManager
|
||||
propertyPath: ForcesManager
|
||||
value:
|
||||
objectReference: {fileID: 1659830376}
|
||||
m_RemovedComponents: []
|
||||
@ -5592,6 +5608,18 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 592057803}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.y.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: InitialModule.startSpeed.scalar
|
||||
value: -1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.speedModifier.scalar
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3680835022977216242, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gravity Changer (3)
|
||||
@ -5638,10 +5666,10 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: _gravity
|
||||
value: 4
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: forcesManager
|
||||
propertyPath: ForcesManager
|
||||
value:
|
||||
objectReference: {fileID: 1659830376}
|
||||
m_RemovedComponents: []
|
||||
@ -5732,6 +5760,38 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 592057803}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.y.scalar
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.orbitalX.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.orbitalY.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.orbitalZ.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: InitialModule.startSpeed.scalar
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: EmissionModule.rateOverTime.scalar
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: InitialModule.startLifetime.scalar
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2798249376021352391, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: VelocityModule.speedModifier.scalar
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3680835022977216242, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gravity Changer (2)
|
||||
@ -5778,10 +5838,10 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: _gravity
|
||||
value: 3
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6433935702469069213, guid: 6926b3895381aea48b807d579c1ce6a0, type: 3}
|
||||
propertyPath: forcesManager
|
||||
propertyPath: ForcesManager
|
||||
value:
|
||||
objectReference: {fileID: 1659830376}
|
||||
m_RemovedComponents: []
|
||||
|
||||
@ -12,51 +12,53 @@ public class BaseShipProperties : ScriptableObject
|
||||
{
|
||||
[Header("Basic Movement")]
|
||||
[Tooltip("The acceleration applied on thrust input.")]
|
||||
public float thrustAcceleration = 2000;
|
||||
public float ThrustAcceleration = 2000;
|
||||
[Tooltip("The velocity with which the character can rotate around it's center.")]
|
||||
public float steerVelocity = 360;
|
||||
public float SteerVelocity = 360;
|
||||
[Header("Max Velocity & Drag")]
|
||||
[Tooltip("The standard limit of character velocity.")]
|
||||
public float normalMaxVelocity = 15f;
|
||||
public float NormalMaxVelocity = 15f;
|
||||
[Tooltip("The absolute maximum of character velocity (enforced by drag).")]
|
||||
public float absolutMaxVelocity = 25f;
|
||||
public float AbsolutMaxVelocity = 25f;
|
||||
[Tooltip("The drag which acts opposite to the characters movement direction normally.")]
|
||||
public float normalDrag = 5f;
|
||||
public float NormalDrag = 5f;
|
||||
[Tooltip("The maximum drag which can act opposite to the characters movement direction.")]
|
||||
public float maximumDrag = 10f;
|
||||
public float MaximumDrag = 10f;
|
||||
[Tooltip("The drag which acts opposite to the characters rotation direction normally.")]
|
||||
public float torqueDrag = 0.2f;
|
||||
public float TorqueDrag = 0.2f;
|
||||
[Header("Gravity Strength")]
|
||||
public float GravityStrength = 30f;
|
||||
[Header("Anti-Drift")]
|
||||
[Tooltip("The amount to which the drift of the character is reduced when anti-drift is active.")]
|
||||
public float antiDriftAmount = 12;
|
||||
public float AntiDriftAmount = 12;
|
||||
[Tooltip("The amount to which the drift of the character is always reduced.")]
|
||||
public float minAntiDriftFactor = 0.03f;
|
||||
public float MinAntiDriftFactor = 0.03f;
|
||||
[Header("Boost")]
|
||||
[Tooltip("The time which is used up when a player uses boost.")]
|
||||
public float maxBoostCapacity = 3.3f;
|
||||
public float MaxBoostCapacity = 3.3f;
|
||||
[Tooltip("The point at which a player can boost again when boost is reloading.")]
|
||||
public float minBoostCapacity = 0.15f;
|
||||
public float MinBoostCapacity = 0.15f;
|
||||
[Tooltip("The factor with which the thrust is multiplied while boosting.")]
|
||||
public float boostMagnitude = 1.5f;
|
||||
public float BoostMagnitude = 1.5f;
|
||||
[Tooltip("The flat tax on the boost when outside of a recharging zone (capacity -= rate * time in seconds).")]
|
||||
public float outsideBoostRate = 0.0f;
|
||||
public float OutsideBoostRate = 0.0f;
|
||||
[Tooltip("The factor of gravity which is eliminated by boosting (1 = no gravity).")]
|
||||
public float boostAntiGravityFactor = 0.33f;
|
||||
public float BoostAntiGravityFactor = 0.33f;
|
||||
[Header("Stun & Tackle")]
|
||||
[Tooltip("The factor by which the player looses control over the character when being stunned (0 = no control).")]
|
||||
public float stunLooseControlFactor = 0.1f;
|
||||
public float StunLooseControlFactor = 0.1f;
|
||||
[Tooltip("Time until the tackling player can be tackled again")]
|
||||
public float tacklingGraceTime = 0.6f;
|
||||
public float TacklingGraceTime = 0.6f;
|
||||
[Tooltip("Time until the tackled player can be tackled again")]
|
||||
public float tackledGraceTime = 0.6f;
|
||||
public float TackledGraceTime = 0.6f;
|
||||
[Tooltip("The time it takes for a critically stunned character to be controlable again.")]
|
||||
public float tackledCriticalStunTime = 0.6f;
|
||||
public float TackledCriticalStunTime = 0.6f;
|
||||
[Tooltip("The time it takes for a normally stunned character to be controlable again.")]
|
||||
public float tackledBodyStunTime = 0.3f;
|
||||
public float TackledBodyStunTime = 0.3f;
|
||||
[Tooltip("The power with which the character is tackled away, when hit critically.")]
|
||||
public float criticalTacklePowerFactor = 60f;
|
||||
public float CriticalTacklePowerFactor = 60f;
|
||||
[Tooltip("The power with which the character is tackled away, when hit normally.")]
|
||||
public float normalTacklePowerFactor = 40f;
|
||||
public float NormalTacklePowerFactor = 40f;
|
||||
[Header("Ship sounds")]
|
||||
public ShipAudio audio;
|
||||
public ShipAudio Audio;
|
||||
}
|
||||
|
||||
@ -9,174 +9,159 @@ using UnityEngine;
|
||||
public class ShipProperties : ScriptableObject
|
||||
{
|
||||
[Tooltip("The base properties for all ships.")]
|
||||
public BaseShipProperties baseProps;
|
||||
public BaseShipProperties BaseProps;
|
||||
[Tooltip("Prefab which contains the whole ship gameobject.")]
|
||||
public GameObject shipPrefab = null;
|
||||
public GameObject ShipPrefab = null;
|
||||
[Tooltip("Object which relays the user input to the ships state.")]
|
||||
public ShipInputHandler shipInput = null;
|
||||
public ShipInputHandler ShipInput = null;
|
||||
[Tooltip("Name of the ship (relevant to UI and lore context).")]
|
||||
public string shipName = "SpaceyMcShipface";
|
||||
public string ShipName = "SpaceyMcShipface";
|
||||
[Tooltip("The main color of the ship.")]
|
||||
public Color shipHullColor = Color.magenta;
|
||||
public Color ShipHullColor = Color.magenta;
|
||||
|
||||
[Tooltip("The acceleration applied on thrust input.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float thrustAccelerationModifier = 1;
|
||||
[HideInInspector]
|
||||
public float thrustAcceleration
|
||||
{ get => baseProps.thrustAcceleration * thrustAccelerationModifier; }
|
||||
public float ThrustAcceleration => BaseProps.ThrustAcceleration * thrustAccelerationModifier;
|
||||
|
||||
[Tooltip("The velocity with which the character can rotate around it's center.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float steerVelocityModifier = 1;
|
||||
[HideInInspector]
|
||||
public float steerVelocity
|
||||
{ get => baseProps.steerVelocity * steerVelocityModifier; }
|
||||
public float SteerVelocity => BaseProps.SteerVelocity * steerVelocityModifier;
|
||||
|
||||
[Tooltip("The standard limit of character velocity.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float normalMaxVelocityModifier = 1;
|
||||
[HideInInspector]
|
||||
public float normalMaxVelocity
|
||||
{ get => baseProps.normalMaxVelocity * normalMaxVelocityModifier; }
|
||||
public float NormalMaxVelocity => BaseProps.NormalMaxVelocity * normalMaxVelocityModifier;
|
||||
|
||||
[Tooltip("The absolute maximum of character velocity (enforced by drag).")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float absolutMaxVelocityModifier = 1;
|
||||
[HideInInspector]
|
||||
public float absolutMaxVelocity
|
||||
{ get => baseProps.absolutMaxVelocity * absolutMaxVelocityModifier; }
|
||||
public float AbsolutMaxVelocity => BaseProps.AbsolutMaxVelocity * absolutMaxVelocityModifier;
|
||||
|
||||
[Tooltip("The strength of gravity acting on a character.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float gravityStrengthModifier = 1;
|
||||
[HideInInspector]
|
||||
public float GravitStrength => BaseProps.GravityStrength * gravityStrengthModifier;
|
||||
|
||||
[Tooltip("The amount to which the drift of the character is reduced when anti-drift is active.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float antiDriftAmountModifier = 1;
|
||||
[HideInInspector]
|
||||
public float antiDriftAmount
|
||||
{ get => baseProps.antiDriftAmount * antiDriftAmountModifier; }
|
||||
public float AntiDriftAmount => BaseProps.AntiDriftAmount * antiDriftAmountModifier;
|
||||
|
||||
[Tooltip("The amount to which the drift of the character is always reduced.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float minAntiDriftFactorModifier = 1;
|
||||
[HideInInspector]
|
||||
public float minAntiDriftFactor
|
||||
{ get => baseProps.minAntiDriftFactor * minAntiDriftFactorModifier; }
|
||||
public float MinAntiDriftFactor => BaseProps.MinAntiDriftFactor * minAntiDriftFactorModifier;
|
||||
|
||||
[Tooltip("The drag which acts opposite to the characters movement direction normally.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float normalDragModifier = 1;
|
||||
[HideInInspector]
|
||||
public float normalDrag
|
||||
{ get => baseProps.normalDrag * normalDragModifier; }
|
||||
public float NormalDrag => BaseProps.NormalDrag * normalDragModifier;
|
||||
|
||||
[Tooltip("The maximum drag which can act opposite to the characters movement direction.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float maximumDragModifier = 1;
|
||||
[HideInInspector]
|
||||
public float maximumDrag
|
||||
{ get => baseProps.maximumDrag * maximumDragModifier; }
|
||||
public float MaximumDrag => BaseProps.MaximumDrag * maximumDragModifier;
|
||||
|
||||
[Tooltip("The drag which acts opposite to the characters rotation direction normally.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float torqueDragModifier = 1;
|
||||
[HideInInspector]
|
||||
public float torqueDrag
|
||||
{ get => baseProps.torqueDrag * torqueDragModifier; }
|
||||
public float TorqueDrag => BaseProps.TorqueDrag * torqueDragModifier;
|
||||
|
||||
[Tooltip("The time which is used up when a player uses boost.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float maxBoostCapacityModifier = 1;
|
||||
[HideInInspector]
|
||||
public float maxBoostCapacity
|
||||
{ get => baseProps.maxBoostCapacity * maxBoostCapacityModifier; }
|
||||
public float MaxBoostCapacity => BaseProps.MaxBoostCapacity * maxBoostCapacityModifier;
|
||||
|
||||
[Tooltip("The point at which a player can boost again when boost is reloading.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float minBoostCapacityModifier = 1;
|
||||
[HideInInspector]
|
||||
public float minBoostCapacity
|
||||
{ get => baseProps.minBoostCapacity * minBoostCapacityModifier; }
|
||||
public float MinBoostCapacity => BaseProps.MinBoostCapacity * minBoostCapacityModifier;
|
||||
|
||||
[Tooltip("The factor with which the thrust is multiplied while boosting.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float boostMagnitudeModifier = 1;
|
||||
[HideInInspector]
|
||||
public float boostMagnitude
|
||||
{ get => baseProps.boostMagnitude * boostMagnitudeModifier; }
|
||||
public float BoostMagnitude => BaseProps.BoostMagnitude * boostMagnitudeModifier;
|
||||
|
||||
[Tooltip("The flat tax on the boost when outside of a recharging zone (capacity -= rate * time in seconds).")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float outsideBoostRateModifier = 1;
|
||||
[HideInInspector]
|
||||
public float outsideBoostRate
|
||||
{ get => baseProps.outsideBoostRate * outsideBoostRateModifier; }
|
||||
public float OutsideBoostRate => BaseProps.OutsideBoostRate * outsideBoostRateModifier;
|
||||
|
||||
|
||||
[Tooltip("The factor of gravity which is eliminated by boosting (1 = no gravity).")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float boostAntiGravityFactorModifier = 1;
|
||||
[HideInInspector]
|
||||
public float boostAntiGravityFactor
|
||||
{ get => baseProps.boostAntiGravityFactor * boostAntiGravityFactorModifier; }
|
||||
public float BoostAntiGravityFactor => BaseProps.BoostAntiGravityFactor * boostAntiGravityFactorModifier;
|
||||
|
||||
[Tooltip("The factor by which the player looses control over the character when being stunned (0 = no control).")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float stunLooseControlFactorModifier = 1;
|
||||
[HideInInspector]
|
||||
public float stunLooseControlFactor
|
||||
{ get => baseProps.stunLooseControlFactor * stunLooseControlFactorModifier; }
|
||||
public float StunLooseControlFactor => BaseProps.StunLooseControlFactor * stunLooseControlFactorModifier;
|
||||
|
||||
[Tooltip("Time until the tackling player can be tackled again")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float tacklingGraceTimeModifier = 1;
|
||||
[HideInInspector]
|
||||
public float tacklingGraceTime
|
||||
{ get => baseProps.tacklingGraceTime * tacklingGraceTimeModifier; }
|
||||
public float TacklingGraceTime => BaseProps.TacklingGraceTime * tacklingGraceTimeModifier;
|
||||
[Tooltip("Time until the tackled player can be tackled again")]
|
||||
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float tackledGraceTimeModifier = 1;
|
||||
[HideInInspector]
|
||||
public float tackledGraceTime
|
||||
{ get => baseProps.tackledGraceTime * tackledGraceTimeModifier; }
|
||||
public float TackledGraceTime => BaseProps.TackledGraceTime * tackledGraceTimeModifier;
|
||||
|
||||
[Tooltip("The time it takes for a critically stunned character to be controlable again.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float tackleCriticalStunTimeModifier = 1;
|
||||
[HideInInspector]
|
||||
public float tackledCriticalStunTime
|
||||
{ get => baseProps.tackledCriticalStunTime * tackleCriticalStunTimeModifier; }
|
||||
public float TackledCriticalStunTime => BaseProps.TackledCriticalStunTime * tackleCriticalStunTimeModifier;
|
||||
|
||||
[Tooltip("The time it takes for a normally stunned character to be controlable again.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float tackleBodyStunTimeModifier = 1;
|
||||
[HideInInspector]
|
||||
public float tackledBodyStunTime
|
||||
{ get => baseProps.tackledBodyStunTime * tackleBodyStunTimeModifier; }
|
||||
public float TackledBodyStunTime => BaseProps.TackledBodyStunTime * tackleBodyStunTimeModifier;
|
||||
|
||||
[Tooltip("The power with which the character is tackled away, when hit critically.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float criticalTacklePowerFactorModifier = 1;
|
||||
[HideInInspector]
|
||||
public float criticalTacklePowerFactor
|
||||
{ get => baseProps.criticalTacklePowerFactor * criticalTacklePowerFactorModifier; }
|
||||
public float CriticalTacklePowerFactor => BaseProps.CriticalTacklePowerFactor * criticalTacklePowerFactorModifier;
|
||||
|
||||
[Tooltip("The power with which the character is tackled away, when hit normally.")]
|
||||
[Range(0.0f, 10.0f)]
|
||||
public float normalTacklePowerFactorModifier = 1;
|
||||
[HideInInspector]
|
||||
public float normalTacklePowerFactor
|
||||
{ get => baseProps.normalTacklePowerFactor * normalTacklePowerFactorModifier; }
|
||||
public float NormalTacklePowerFactor => BaseProps.NormalTacklePowerFactor * normalTacklePowerFactorModifier;
|
||||
|
||||
[Tooltip("Overwrite the default ship sounds or leave empty")]
|
||||
public ShipAudio alternativeShipSounds;
|
||||
[HideInInspector]
|
||||
public ShipAudio audio
|
||||
public ShipAudio Audio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (alternativeShipSounds == null)
|
||||
{
|
||||
return baseProps.audio;
|
||||
return BaseProps.Audio;
|
||||
}
|
||||
return alternativeShipSounds;
|
||||
}
|
||||
|
||||
@ -12,25 +12,26 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d4e63b7217e6a2f499d6da3911f6da33, type: 3}
|
||||
m_Name: BaseShip
|
||||
m_EditorClassIdentifier:
|
||||
thrustAcceleration: 1300
|
||||
steerVelocity: 360
|
||||
normalMaxVelocity: 19
|
||||
absolutMaxVelocity: 29
|
||||
normalDrag: 5
|
||||
maximumDrag: 10
|
||||
torqueDrag: 0.2
|
||||
antiDriftAmount: 8
|
||||
minAntiDriftFactor: 0.5
|
||||
maxBoostCapacity: 4
|
||||
minBoostCapacity: 0.5
|
||||
boostMagnitude: 2
|
||||
outsideBoostRate: 0
|
||||
boostAntiGravityFactor: 0.8
|
||||
stunLooseControlFactor: 0.1
|
||||
tacklingGraceTime: 0.6
|
||||
tackledGraceTime: 0.3
|
||||
tackledCriticalStunTime: 0.6
|
||||
tackledBodyStunTime: 0.3
|
||||
criticalTacklePowerFactor: 300
|
||||
normalTacklePowerFactor: 300
|
||||
audio: {fileID: 11400000, guid: 96db7e9f041aed7459cb776fddee1741, type: 2}
|
||||
ThrustAcceleration: 2000
|
||||
SteerVelocity: 360
|
||||
NormalMaxVelocity: 15
|
||||
AbsolutMaxVelocity: 25
|
||||
NormalDrag: 5
|
||||
MaximumDrag: 10
|
||||
TorqueDrag: 0.2
|
||||
GravityStrength: 30
|
||||
AntiDriftAmount: 12
|
||||
MinAntiDriftFactor: 0.03
|
||||
MaxBoostCapacity: 3.3
|
||||
MinBoostCapacity: 0.15
|
||||
BoostMagnitude: 1.5
|
||||
OutsideBoostRate: 0
|
||||
BoostAntiGravityFactor: 0.33
|
||||
StunLooseControlFactor: 0.1
|
||||
TacklingGraceTime: 0.6
|
||||
TackledGraceTime: 0.6
|
||||
TackledCriticalStunTime: 0.6
|
||||
TackledBodyStunTime: 0.3
|
||||
CriticalTacklePowerFactor: 60
|
||||
NormalTacklePowerFactor: 40
|
||||
Audio: {fileID: 11400000, guid: 96db7e9f041aed7459cb776fddee1741, type: 2}
|
||||
|
||||
@ -12,14 +12,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f5cabb9de76fbfa49b5ccac30cd25c68, type: 3}
|
||||
m_Name: BlueShip
|
||||
m_EditorClassIdentifier:
|
||||
baseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
shipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
shipName: Blue Blitz
|
||||
shipHullColor: {r: 0, g: 0.62125206, b: 1, a: 1}
|
||||
BaseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
ShipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
ShipName: Blue Blitz
|
||||
ShipHullColor: {r: 0, g: 0.3522544, b: 1, a: 1}
|
||||
thrustAccelerationModifier: 1
|
||||
steerVelocityModifier: 1
|
||||
normalMaxVelocityModifier: 1
|
||||
absolutMaxVelocityModifier: 1
|
||||
gravityStrengthModifier: 1
|
||||
antiDriftAmountModifier: 1
|
||||
minAntiDriftFactorModifier: 1
|
||||
normalDragModifier: 1
|
||||
@ -31,7 +32,10 @@ MonoBehaviour:
|
||||
outsideBoostRateModifier: 1
|
||||
boostAntiGravityFactorModifier: 1
|
||||
stunLooseControlFactorModifier: 1
|
||||
tacklingGraceTimeModifier: 1
|
||||
tackledGraceTimeModifier: 1
|
||||
tackleCriticalStunTimeModifier: 1
|
||||
tackleBodyStunTimeModifier: 1
|
||||
criticalTacklePowerFactorModifier: 1
|
||||
normalTacklePowerFactorModifier: 1
|
||||
alternativeShipSounds: {fileID: 0}
|
||||
|
||||
@ -12,14 +12,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f5cabb9de76fbfa49b5ccac30cd25c68, type: 3}
|
||||
m_Name: GreenShip
|
||||
m_EditorClassIdentifier:
|
||||
baseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
shipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
shipName: Green Danger
|
||||
shipHullColor: {r: 0, g: 1, b: 0.40690804, a: 1}
|
||||
BaseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
ShipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
ShipName: Green Danger
|
||||
ShipHullColor: {r: 0.0276097, g: 0.81886786, b: 0, a: 1}
|
||||
thrustAccelerationModifier: 1
|
||||
steerVelocityModifier: 1
|
||||
normalMaxVelocityModifier: 1
|
||||
absolutMaxVelocityModifier: 1
|
||||
gravityStrengthModifier: 1
|
||||
antiDriftAmountModifier: 1
|
||||
minAntiDriftFactorModifier: 1
|
||||
normalDragModifier: 1
|
||||
@ -31,7 +32,10 @@ MonoBehaviour:
|
||||
outsideBoostRateModifier: 1
|
||||
boostAntiGravityFactorModifier: 1
|
||||
stunLooseControlFactorModifier: 1
|
||||
tacklingGraceTimeModifier: 1
|
||||
tackledGraceTimeModifier: 1
|
||||
tackleCriticalStunTimeModifier: 1
|
||||
tackleBodyStunTimeModifier: 1
|
||||
criticalTacklePowerFactorModifier: 1
|
||||
normalTacklePowerFactorModifier: 1
|
||||
alternativeShipSounds: {fileID: 0}
|
||||
|
||||
@ -12,14 +12,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f5cabb9de76fbfa49b5ccac30cd25c68, type: 3}
|
||||
m_Name: PurpleShip
|
||||
m_EditorClassIdentifier:
|
||||
baseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
shipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
shipName: Purple Haze
|
||||
shipHullColor: {r: 0.6345311, g: 0.17924517, b: 1, a: 1}
|
||||
BaseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
ShipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
ShipName: Purple Burglar
|
||||
ShipHullColor: {r: 0.69604963, g: 0, b: 0.8490566, a: 1}
|
||||
thrustAccelerationModifier: 1
|
||||
steerVelocityModifier: 1
|
||||
normalMaxVelocityModifier: 1
|
||||
absolutMaxVelocityModifier: 1
|
||||
gravityStrengthModifier: 1
|
||||
antiDriftAmountModifier: 1
|
||||
minAntiDriftFactorModifier: 1
|
||||
normalDragModifier: 1
|
||||
@ -31,7 +32,10 @@ MonoBehaviour:
|
||||
outsideBoostRateModifier: 1
|
||||
boostAntiGravityFactorModifier: 1
|
||||
stunLooseControlFactorModifier: 1
|
||||
tacklingGraceTimeModifier: 1
|
||||
tackledGraceTimeModifier: 1
|
||||
tackleCriticalStunTimeModifier: 1
|
||||
tackleBodyStunTimeModifier: 1
|
||||
criticalTacklePowerFactorModifier: 1
|
||||
normalTacklePowerFactorModifier: 1
|
||||
alternativeShipSounds: {fileID: 0}
|
||||
|
||||
@ -12,14 +12,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f5cabb9de76fbfa49b5ccac30cd25c68, type: 3}
|
||||
m_Name: RedShip
|
||||
m_EditorClassIdentifier:
|
||||
baseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
shipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
shipName: Red Menace
|
||||
shipHullColor: {r: 0.9924528, g: 0.18470371, b: 0.1404413, a: 1}
|
||||
BaseProps: {fileID: 11400000, guid: 8bb9b96c7ef17e94bbd897292f08cd4e, type: 2}
|
||||
ShipPrefab: {fileID: 1372816401649438144, guid: 75db4d0681fa51f4bb6106997f11022e, type: 3}
|
||||
ShipName: Red Menace
|
||||
ShipHullColor: {r: 1, g: 0.13396227, b: 0.15771939, a: 1}
|
||||
thrustAccelerationModifier: 1
|
||||
steerVelocityModifier: 1
|
||||
normalMaxVelocityModifier: 1
|
||||
absolutMaxVelocityModifier: 1
|
||||
gravityStrengthModifier: 1
|
||||
antiDriftAmountModifier: 1
|
||||
minAntiDriftFactorModifier: 1
|
||||
normalDragModifier: 1
|
||||
@ -31,7 +32,10 @@ MonoBehaviour:
|
||||
outsideBoostRateModifier: 1
|
||||
boostAntiGravityFactorModifier: 1
|
||||
stunLooseControlFactorModifier: 1
|
||||
tacklingGraceTimeModifier: 1
|
||||
tackledGraceTimeModifier: 1
|
||||
tackleCriticalStunTimeModifier: 1
|
||||
tackleBodyStunTimeModifier: 1
|
||||
criticalTacklePowerFactorModifier: 1
|
||||
normalTacklePowerFactorModifier: 1
|
||||
alternativeShipSounds: {fileID: 0}
|
||||
|
||||
@ -86,7 +86,7 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
void Start()
|
||||
{
|
||||
InstanceID = gameObject.GetInstanceID();
|
||||
state.boostCapacity = props.maxBoostCapacity;
|
||||
state.boostCapacity = props.MaxBoostCapacity;
|
||||
// boostUI.SetMinBoostRatio(props.minBoostCapacity / props.maxBoostCapacity);
|
||||
// GameManager.GM.RegisterPlayer(this);
|
||||
cameraOperator.AddCharacter(smoothedRepresentation);
|
||||
@ -140,7 +140,7 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
{
|
||||
//Debug.Log("inupdatemove " + currentThrustInput);
|
||||
// Player rotation is always possible and same speed
|
||||
transform.Rotate(0, 0, (float)(-props.steerVelocity * rd.Steer * 2 * TimeManager.TickDelta));
|
||||
transform.Rotate(0, 0, (float)(-props.SteerVelocity * rd.Steer * 2 * TimeManager.TickDelta));
|
||||
//PredictionRigidbody.AddTorque(new Vector3(0, 0, -props.steerVelocity * rd.Steer * Time.deltaTime));
|
||||
|
||||
// // Get and apply the current Gravity
|
||||
@ -148,10 +148,10 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
state.currentGravity = forceManager.GetGravityForInstance(InstanceID)(gravitySource, transform);
|
||||
PredictionRigidbody.AddForce(state.currentGravity, ForceMode.Acceleration);
|
||||
|
||||
float stunFactor = isCriticalTackle ? props.stunLooseControlFactor : 1f;
|
||||
float stunFactor = isCriticalTackle ? props.StunLooseControlFactor : 1f;
|
||||
|
||||
float thrust = IsBoosting(rd.Boost) ? 1f : rd.Thrust;
|
||||
Vector3 acceleration = props.thrustAcceleration * thrust * (float)TimeManager.TickDelta
|
||||
Vector3 acceleration = props.ThrustAcceleration * thrust * (float)TimeManager.TickDelta
|
||||
* transform.up * stunFactor * 2;
|
||||
|
||||
Vector3 currentVelocity = body.velocity;
|
||||
@ -175,20 +175,20 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
}
|
||||
}
|
||||
|
||||
if (currentVelocity.magnitude <= props.normalMaxVelocity || IsBoosting(rd.Boost)
|
||||
if (currentVelocity.magnitude <= props.NormalMaxVelocity || IsBoosting(rd.Boost)
|
||||
|| zone != Zone.NimbleZone)
|
||||
{
|
||||
PredictionRigidbody.AddForce(boostedAcceleration, ForceMode.Acceleration);
|
||||
|
||||
}
|
||||
if (currentVelocity.magnitude >= props.absolutMaxVelocity && zone == Zone.NimbleZone)
|
||||
if (currentVelocity.magnitude >= props.AbsolutMaxVelocity && zone == Zone.NimbleZone)
|
||||
{
|
||||
body.velocity = body.velocity.normalized * props.absolutMaxVelocity;
|
||||
body.velocity = body.velocity.normalized * props.AbsolutMaxVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
// Default torque drag
|
||||
PredictionRigidbody.AddRelativeTorque(body.angularVelocity * -props.torqueDrag, ForceMode.Acceleration);
|
||||
PredictionRigidbody.AddRelativeTorque(body.angularVelocity * -props.TorqueDrag, ForceMode.Acceleration);
|
||||
|
||||
// Debug.DrawRay(transform.position, transform.up * (currentVelocity.magnitude + 3) * 0.5f,
|
||||
// Color.black);
|
||||
@ -260,17 +260,17 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
|
||||
//Debug.Log("inupdatemove " + currentThrustInput);
|
||||
// Player rotation is always possible and same speed
|
||||
transform.Rotate(0, 0, -props.steerVelocity * input.steerInput * Time.deltaTime);
|
||||
transform.Rotate(0, 0, -props.SteerVelocity * input.steerInput * Time.deltaTime);
|
||||
|
||||
// Get and apply the current Gravity
|
||||
Transform gravitySource = forceManager.GetGravitySourceForInstance(InstanceID);
|
||||
state.currentGravity = forceManager.GetGravityForInstance(InstanceID)(gravitySource, transform);
|
||||
body.AddForce(state.currentGravity, ForceMode.Acceleration);
|
||||
|
||||
float stunFactor = isCriticalTackle ? props.stunLooseControlFactor : 1f;
|
||||
float stunFactor = isCriticalTackle ? props.StunLooseControlFactor : 1f;
|
||||
|
||||
float thrust = IsBoosting(input.boostInput) ? 1f : input.thrustInput;
|
||||
Vector3 acceleration = props.thrustAcceleration * thrust * Time.deltaTime
|
||||
Vector3 acceleration = props.ThrustAcceleration * thrust * Time.deltaTime
|
||||
* transform.up * stunFactor;
|
||||
|
||||
Vector3 currentVelocity = body.velocity;
|
||||
@ -294,20 +294,20 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
}
|
||||
}
|
||||
|
||||
if (currentVelocity.magnitude <= props.normalMaxVelocity || IsBoosting(input.boostInput)
|
||||
if (currentVelocity.magnitude <= props.NormalMaxVelocity || IsBoosting(input.boostInput)
|
||||
|| zone != Zone.NimbleZone)
|
||||
{
|
||||
body.AddForce(boostedAcceleration, ForceMode.Acceleration);
|
||||
|
||||
}
|
||||
if (currentVelocity.magnitude >= props.absolutMaxVelocity && zone == Zone.NimbleZone)
|
||||
if (currentVelocity.magnitude >= props.AbsolutMaxVelocity && zone == Zone.NimbleZone)
|
||||
{
|
||||
body.velocity = body.velocity.normalized * props.absolutMaxVelocity;
|
||||
body.velocity = body.velocity.normalized * props.AbsolutMaxVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
// Default torque drag
|
||||
body.AddRelativeTorque(body.angularVelocity * -props.torqueDrag, ForceMode.Acceleration);
|
||||
body.AddRelativeTorque(body.angularVelocity * -props.TorqueDrag, ForceMode.Acceleration);
|
||||
|
||||
Debug.DrawRay(transform.position, transform.up * (currentVelocity.magnitude + 3) * 0.5f,
|
||||
Color.black);
|
||||
@ -336,16 +336,16 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
}
|
||||
|
||||
antiDriftVelocity = Vector3.Reflect(-driftVelocity, up) - driftVelocity;
|
||||
antiDriftFactor = Mathf.InverseLerp(props.absolutMaxVelocity, props.normalMaxVelocity,
|
||||
antiDriftFactor = Mathf.InverseLerp(props.AbsolutMaxVelocity, props.NormalMaxVelocity,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
antiDriftFactor = Mathf.Max(antiDriftFactor, props.minAntiDriftFactor);
|
||||
antiDriftFactor = Mathf.Max(antiDriftFactor, props.MinAntiDriftFactor);
|
||||
|
||||
Debug.DrawRay(transform.position, currentVelocity.normalized * currentVelocity.magnitude * 2, Color.cyan);
|
||||
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
||||
Debug.DrawRay(transform.position, antiDriftVelocity.normalized * 5, Color.green);
|
||||
|
||||
return antiDriftVelocity * props.antiDriftAmount * antiDriftFactor;
|
||||
return antiDriftVelocity * props.AntiDriftAmount * antiDriftFactor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -357,19 +357,19 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
Vector3 DragDecceleration(Vector3 currentVelocity, Zone zone)
|
||||
{
|
||||
Vector3 drag = new Vector3();
|
||||
float minDragFactor = Mathf.InverseLerp(props.absolutMaxVelocity, props.normalMaxVelocity,
|
||||
float minDragFactor = Mathf.InverseLerp(props.AbsolutMaxVelocity, props.NormalMaxVelocity,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
float normalDragFactor = Mathf.InverseLerp(props.normalMaxVelocity, 0,
|
||||
float normalDragFactor = Mathf.InverseLerp(props.NormalMaxVelocity, 0,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
if (!IsBoosting(input.boostInput) && zone == Zone.NimbleZone)
|
||||
{
|
||||
drag -= currentVelocity.normalized * props.normalDrag;
|
||||
drag -= currentVelocity.normalized * props.NormalDrag;
|
||||
}
|
||||
if (currentVelocity.magnitude >= props.normalMaxVelocity && zone == Zone.NimbleZone)
|
||||
if (currentVelocity.magnitude >= props.NormalMaxVelocity && zone == Zone.NimbleZone)
|
||||
{
|
||||
drag -= currentVelocity.normalized * props.maximumDrag;
|
||||
drag -= currentVelocity.normalized * props.MaximumDrag;
|
||||
}
|
||||
return drag;
|
||||
}
|
||||
@ -395,8 +395,8 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
{
|
||||
if (IsBoosting(input.boostInput))
|
||||
{
|
||||
acceleration *= props.boostMagnitude;
|
||||
acceleration -= currentGravity * props.boostAntiGravityFactor;
|
||||
acceleration *= props.BoostMagnitude;
|
||||
acceleration -= currentGravity * props.BoostAntiGravityFactor;
|
||||
}
|
||||
return acceleration;
|
||||
}
|
||||
@ -407,14 +407,14 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
/// <param name="deltaTime">Time delta of the current frame</param>
|
||||
void BoostStateUpdate(float deltaTime)
|
||||
{
|
||||
BoostUI.UpdateFill(Math.Min(state.boostCapacity / props.maxBoostCapacity, 1));
|
||||
BoostUI.UpdateFill(Math.Min(state.boostCapacity / props.MaxBoostCapacity, 1));
|
||||
if (IsBoosting(input.boostInput))
|
||||
{
|
||||
state.boostCapacity -= deltaTime;
|
||||
}
|
||||
if (canBoost && zone == Zone.OutsideZone)
|
||||
{
|
||||
state.boostCapacity -= deltaTime * props.outsideBoostRate;
|
||||
state.boostCapacity -= deltaTime * props.OutsideBoostRate;
|
||||
}
|
||||
if (state.boostCapacity <= 0)
|
||||
{
|
||||
@ -423,13 +423,13 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
|
||||
if ((input.boostInput <= 0 || !canBoost)
|
||||
&& zone == Zone.NimbleZone
|
||||
&& state.boostCapacity <= props.maxBoostCapacity)
|
||||
&& state.boostCapacity <= props.MaxBoostCapacity)
|
||||
{
|
||||
state.boostCapacity += deltaTime;
|
||||
}
|
||||
// When your boost capacity is still critical, you can't start boosting immediately again.
|
||||
// TODO: This is not tested well enough with players.
|
||||
if (canBoost == false && state.boostCapacity >= props.minBoostCapacity)
|
||||
if (canBoost == false && state.boostCapacity >= props.MinBoostCapacity)
|
||||
{
|
||||
canBoost = true;
|
||||
}
|
||||
@ -447,8 +447,8 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
if (gotTackled && !isTackled)
|
||||
{
|
||||
isTackled = true;
|
||||
tackledTime = isCriticalTackle ? props.tackledCriticalStunTime :
|
||||
props.tackledBodyStunTime;
|
||||
tackledTime = isCriticalTackle ? props.TackledCriticalStunTime :
|
||||
props.TackledBodyStunTime;
|
||||
return;
|
||||
}
|
||||
tackledTime -= Time.deltaTime;
|
||||
@ -483,8 +483,8 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
{
|
||||
if (IgnoreTackle())
|
||||
return;
|
||||
Log.Debug($"{props.shipName} is tackling.");
|
||||
TemporarilyIgnoreTackles(props.tacklingGraceTime);
|
||||
Log.Debug($"{props.ShipName} is tackling.");
|
||||
TemporarilyIgnoreTackles(props.TacklingGraceTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -497,19 +497,19 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
{
|
||||
if (IgnoreTackle())
|
||||
return;
|
||||
TemporarilyIgnoreTackles(props.tackledGraceTime);
|
||||
TemporarilyIgnoreTackles(props.TackledGraceTime);
|
||||
|
||||
float tacklePowerFactor = props.criticalTacklePowerFactor;
|
||||
float tacklePowerFactor = props.CriticalTacklePowerFactor;
|
||||
if (tackleKind == TackleKind.IncomingCritical)
|
||||
{
|
||||
isCriticalTackle = true;
|
||||
Log.Debug($"{props.shipName} has been tackled critically.");
|
||||
Log.Debug($"{props.ShipName} has been tackled critically.");
|
||||
}
|
||||
else if (tackleKind == TackleKind.IncomingNormal)
|
||||
{
|
||||
isCriticalTackle = false;
|
||||
tacklePowerFactor = props.normalTacklePowerFactor;
|
||||
Log.Debug($"{props.shipName} has been tackled.");
|
||||
tacklePowerFactor = props.NormalTacklePowerFactor;
|
||||
Log.Debug($"{props.ShipName} has been tackled.");
|
||||
}
|
||||
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
||||
//Log.Debug("velocity " + colliderVelocity);
|
||||
@ -545,7 +545,7 @@ public class PredictedShip : NetworkBehaviour, IHUDOwner
|
||||
gravityEffect.Stop();
|
||||
return;
|
||||
}
|
||||
float velocityFactor = math.smoothstep(0, props.absolutMaxVelocity, body.velocity.magnitude);
|
||||
float velocityFactor = math.smoothstep(0, props.AbsolutMaxVelocity, body.velocity.magnitude);
|
||||
if (math.abs(input.thrustInput) > 0 || IsBoosting(input.boostInput))
|
||||
{
|
||||
ThrusterSound.PlayAudio(true);
|
||||
|
||||
@ -57,10 +57,10 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
void Start()
|
||||
{
|
||||
InstanceID = gameObject.GetInstanceID();
|
||||
State.boostCapacity = Props.maxBoostCapacity;
|
||||
State.boostCapacity = Props.MaxBoostCapacity;
|
||||
|
||||
// Get manageable audio instances for the ships sounds
|
||||
foreach (ShipSoundToName stn in Props.audio.shipSounds)
|
||||
foreach (ShipSoundToName stn in Props.Audio.shipSounds)
|
||||
{
|
||||
ManageableAudio ma = AudioManager.G.GetLocalSound(stn.soundName, 1,
|
||||
gameObject.transform);
|
||||
@ -131,17 +131,17 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
|
||||
//Debug.Log("inupdatemove " + currentThrustInput);
|
||||
// Player rotation is always possible and same speed
|
||||
transform.Rotate(0, 0, -Props.steerVelocity * Input.steerInput * Time.deltaTime);
|
||||
transform.Rotate(0, 0, -Props.SteerVelocity * Input.steerInput * Time.deltaTime);
|
||||
|
||||
// Get and apply the current Gravity
|
||||
Transform gravitySource = _forceManager.GetGravitySourceForInstance(InstanceID);
|
||||
State.currentGravity = _forceManager.GetGravityForInstance(InstanceID)(gravitySource, transform);
|
||||
State.currentGravity = _forceManager.GetGravityForInstance(InstanceID)(gravitySource, transform) * Props.GravitStrength;
|
||||
_body.AddForce(State.currentGravity, ForceMode.Acceleration);
|
||||
|
||||
float stunFactor = _isCriticalTackle ? Props.stunLooseControlFactor : 1f;
|
||||
float stunFactor = _isCriticalTackle ? Props.StunLooseControlFactor : 1f;
|
||||
|
||||
float thrust = IsBoosting() ? 1f : Input.thrustInput;
|
||||
Vector3 acceleration = Props.thrustAcceleration * thrust * Time.deltaTime
|
||||
Vector3 acceleration = Props.ThrustAcceleration * thrust * Time.deltaTime
|
||||
* transform.up * stunFactor;
|
||||
|
||||
Vector3 currentVelocity = _body.velocity;
|
||||
@ -165,20 +165,20 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
}
|
||||
}
|
||||
|
||||
if (currentVelocity.magnitude <= Props.normalMaxVelocity || IsBoosting()
|
||||
if (currentVelocity.magnitude <= Props.NormalMaxVelocity || IsBoosting()
|
||||
|| State.Zone != Zone.NimbleZone)
|
||||
{
|
||||
_body.AddForce(boostedAcceleration, ForceMode.Acceleration);
|
||||
|
||||
}
|
||||
if (currentVelocity.magnitude >= Props.absolutMaxVelocity && State.Zone == Zone.NimbleZone)
|
||||
if (currentVelocity.magnitude >= Props.AbsolutMaxVelocity && State.Zone == Zone.NimbleZone)
|
||||
{
|
||||
_body.velocity = _body.velocity.normalized * Props.absolutMaxVelocity;
|
||||
_body.velocity = _body.velocity.normalized * Props.AbsolutMaxVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
// Default torque drag
|
||||
_body.AddRelativeTorque(_body.angularVelocity * -Props.torqueDrag, ForceMode.Acceleration);
|
||||
_body.AddRelativeTorque(_body.angularVelocity * -Props.TorqueDrag, ForceMode.Acceleration);
|
||||
|
||||
Debug.DrawRay(transform.position, transform.up * (currentVelocity.magnitude + 3) * 0.5f,
|
||||
Color.black);
|
||||
@ -208,17 +208,17 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
}
|
||||
|
||||
antiDriftVelocity = Vector3.Reflect(-driftVelocity, up) - driftVelocity;
|
||||
antiDriftFactor = Mathf.InverseLerp(Props.absolutMaxVelocity, Props.normalMaxVelocity,
|
||||
antiDriftFactor = Mathf.InverseLerp(Props.AbsolutMaxVelocity, Props.NormalMaxVelocity,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
antiDriftFactor = Mathf.Max(antiDriftFactor, Props.minAntiDriftFactor);
|
||||
antiDriftFactor = Mathf.Max(antiDriftFactor, Props.MinAntiDriftFactor);
|
||||
|
||||
Debug.DrawRay(transform.position, currentVelocity.normalized * currentVelocity.magnitude * 2,
|
||||
Color.cyan);
|
||||
Debug.DrawRay(transform.position, driftVelocity.normalized * 5, Color.red);
|
||||
Debug.DrawRay(transform.position, antiDriftVelocity.normalized * 5, Color.green);
|
||||
|
||||
return antiDriftVelocity * Props.antiDriftAmount * antiDriftFactor;
|
||||
return antiDriftVelocity * Props.AntiDriftAmount * antiDriftFactor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -230,19 +230,19 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
Vector3 DragDecceleration(Vector3 currentVelocity, Zone zone)
|
||||
{
|
||||
Vector3 drag = new Vector3();
|
||||
float minDragFactor = Mathf.InverseLerp(Props.absolutMaxVelocity, Props.normalMaxVelocity,
|
||||
float minDragFactor = Mathf.InverseLerp(Props.AbsolutMaxVelocity, Props.NormalMaxVelocity,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
float normalDragFactor = Mathf.InverseLerp(Props.normalMaxVelocity, 0,
|
||||
float normalDragFactor = Mathf.InverseLerp(Props.NormalMaxVelocity, 0,
|
||||
currentVelocity.magnitude);
|
||||
|
||||
if (!IsBoosting() && zone == Zone.NimbleZone)
|
||||
{
|
||||
drag -= currentVelocity.normalized * Props.normalDrag;
|
||||
drag -= currentVelocity.normalized * Props.NormalDrag;
|
||||
}
|
||||
if (currentVelocity.magnitude >= Props.normalMaxVelocity && zone == Zone.NimbleZone)
|
||||
if (currentVelocity.magnitude >= Props.NormalMaxVelocity && zone == Zone.NimbleZone)
|
||||
{
|
||||
drag -= currentVelocity.normalized * Props.maximumDrag;
|
||||
drag -= currentVelocity.normalized * Props.MaximumDrag;
|
||||
}
|
||||
return drag;
|
||||
}
|
||||
@ -268,8 +268,8 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
{
|
||||
if (IsBoosting())
|
||||
{
|
||||
acceleration *= Props.boostMagnitude;
|
||||
acceleration -= currentGravity * Props.boostAntiGravityFactor;
|
||||
acceleration *= Props.BoostMagnitude;
|
||||
acceleration -= currentGravity * Props.BoostAntiGravityFactor;
|
||||
}
|
||||
return acceleration;
|
||||
}
|
||||
@ -280,14 +280,14 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
/// <param name="deltaTime">Time delta of the current frame</param>
|
||||
void BoostStateUpdate(float deltaTime)
|
||||
{
|
||||
BoostUI.UpdateFill(Math.Min(State.boostCapacity / Props.maxBoostCapacity, 1));
|
||||
BoostUI.UpdateFill(Math.Min(State.boostCapacity / Props.MaxBoostCapacity, 1));
|
||||
if (IsBoosting())
|
||||
{
|
||||
State.boostCapacity -= deltaTime;
|
||||
}
|
||||
if (_canBoost && State.Zone == Zone.OutsideZone)
|
||||
{
|
||||
State.boostCapacity -= deltaTime * Props.outsideBoostRate;
|
||||
State.boostCapacity -= deltaTime * Props.OutsideBoostRate;
|
||||
}
|
||||
if (State.boostCapacity <= 0)
|
||||
{
|
||||
@ -296,13 +296,13 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
|
||||
if ((Input.boostInput <= 0 || !_canBoost)
|
||||
&& State.Zone == Zone.NimbleZone
|
||||
&& State.boostCapacity <= Props.maxBoostCapacity)
|
||||
&& State.boostCapacity <= Props.MaxBoostCapacity)
|
||||
{
|
||||
State.boostCapacity += deltaTime;
|
||||
}
|
||||
// When your boost capacity is still critical, you can't start boosting immediately again.
|
||||
// TODO: This is not tested well enough with players.
|
||||
if (_canBoost == false && State.boostCapacity >= Props.minBoostCapacity)
|
||||
if (_canBoost == false && State.boostCapacity >= Props.MinBoostCapacity)
|
||||
{
|
||||
_canBoost = true;
|
||||
}
|
||||
@ -320,8 +320,8 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
if (gotTackled && !_isTackled)
|
||||
{
|
||||
_isTackled = true;
|
||||
_tackledTime = _isCriticalTackle ? Props.tackledCriticalStunTime :
|
||||
Props.tackledBodyStunTime;
|
||||
_tackledTime = _isCriticalTackle ? Props.TackledCriticalStunTime :
|
||||
Props.TackledBodyStunTime;
|
||||
return;
|
||||
}
|
||||
_tackledTime -= Time.deltaTime;
|
||||
@ -356,8 +356,8 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
{
|
||||
if (IgnoreTackle())
|
||||
return;
|
||||
Log.Debug($"{Props.shipName} is tackling.");
|
||||
TemporarilyIgnoreTackles(Props.tacklingGraceTime);
|
||||
Log.Debug($"{Props.ShipName} is tackling.");
|
||||
TemporarilyIgnoreTackles(Props.TacklingGraceTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -370,19 +370,19 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
{
|
||||
if (IgnoreTackle())
|
||||
return;
|
||||
TemporarilyIgnoreTackles(Props.tackledGraceTime);
|
||||
TemporarilyIgnoreTackles(Props.TackledGraceTime);
|
||||
|
||||
float tacklePowerFactor = Props.criticalTacklePowerFactor;
|
||||
float tacklePowerFactor = Props.CriticalTacklePowerFactor;
|
||||
if (tackleKind == TackleKind.IncomingCritical)
|
||||
{
|
||||
_isCriticalTackle = true;
|
||||
Log.Debug($"{Props.shipName} has been tackled critically.");
|
||||
Log.Debug($"{Props.ShipName} has been tackled critically.");
|
||||
}
|
||||
else if (tackleKind == TackleKind.IncomingNormal)
|
||||
{
|
||||
_isCriticalTackle = false;
|
||||
tacklePowerFactor = Props.normalTacklePowerFactor;
|
||||
Log.Debug($"{Props.shipName} has been tackled.");
|
||||
tacklePowerFactor = Props.NormalTacklePowerFactor;
|
||||
Log.Debug($"{Props.ShipName} has been tackled.");
|
||||
}
|
||||
Vector3 colliderVelocity = collider.attachedRigidbody.velocity;
|
||||
//Log.Debug("velocity " + colliderVelocity);
|
||||
@ -418,7 +418,7 @@ public class Ship : MonoBehaviour, IHUDOwner
|
||||
GravityEffect.Stop();
|
||||
return;
|
||||
}
|
||||
float velocityFactor = math.smoothstep(0, Props.absolutMaxVelocity, _body.velocity.magnitude);
|
||||
float velocityFactor = math.smoothstep(0, Props.AbsolutMaxVelocity, _body.velocity.magnitude);
|
||||
if (math.abs(Input.thrustInput) > 0 || IsBoosting())
|
||||
{
|
||||
sounds[Thruster].PlayAudio(true);
|
||||
|
||||
@ -1,150 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Managers;
|
||||
using Unity.Mathematics;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using static AffectingForcesManager;
|
||||
using static GravityFunctionality.GravityHelpers;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class GravityChanger : MonoBehaviour
|
||||
namespace GravityFunctionality
|
||||
{
|
||||
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static Transform _nimbleZoneTransform;
|
||||
public AffectingForcesManager forcesManager;
|
||||
[ExecuteInEditMode]
|
||||
public class GravityChanger : MonoBehaviour
|
||||
{
|
||||
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static Transform _nimbleZoneTransform;
|
||||
|
||||
public GameObject renderedZoneObject;
|
||||
public GameObject RenderedZoneObject;
|
||||
public ParticleSystem GravityEffect;
|
||||
|
||||
[SerializeField]
|
||||
private List<GravityColorEntry> GravityColors = new();
|
||||
[SerializeField]
|
||||
private List<GravityColorEntry> GravityColors = new();
|
||||
|
||||
private Dictionary<Gravity, Color> _gravityColors =
|
||||
new Dictionary<Gravity, Color>
|
||||
{
|
||||
private Dictionary<Gravity, Color> _gravityColors =
|
||||
new Dictionary<Gravity, Color>
|
||||
{
|
||||
{Gravity.DownGravity, Color.green },
|
||||
{Gravity.UpGravity, Color.magenta },
|
||||
{Gravity.NoGravity, Color.red },
|
||||
{Gravity.InwardsGravity, Color.blue },
|
||||
{Gravity.OutwardsGravity, Color.yellow },
|
||||
};
|
||||
};
|
||||
|
||||
[SerializeField]
|
||||
private static float _gravityFactor = 30f;
|
||||
|
||||
[SerializeField]
|
||||
private Gravity _gravity = Gravity.NoGravity;
|
||||
[SerializeField]
|
||||
private Gravity _gravity = Gravity.NoGravity;
|
||||
private AffectingForcesManager _forcesManager;
|
||||
|
||||
private int maxRippleAmount = 5;
|
||||
private MeshRenderer meshRenderer;
|
||||
private Material material;
|
||||
private MeshRenderer meshRenderer;
|
||||
private Material material;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
foreach (GravityColorEntry entry in GravityColors)
|
||||
void Awake()
|
||||
{
|
||||
_gravityColors[entry.gravity] = entry.color;
|
||||
}
|
||||
meshRenderer = renderedZoneObject.GetComponent<MeshRenderer>();
|
||||
_nimbleZoneTransform = gameObject.transform;
|
||||
ApplyZoneColor(meshRenderer);
|
||||
if (_forcesManager == null)
|
||||
{
|
||||
_forcesManager = GameObject.FindGameObjectWithTag("ForceManager").
|
||||
GetComponent<AffectingForcesManager>();
|
||||
}
|
||||
foreach (GravityColorEntry entry in GravityColors)
|
||||
{
|
||||
_gravityColors[entry.gravity] = entry.color;
|
||||
}
|
||||
meshRenderer = RenderedZoneObject.GetComponent<MeshRenderer>();
|
||||
_nimbleZoneTransform = gameObject.transform;
|
||||
ApplyZoneColor(meshRenderer);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
|
||||
material = meshRenderer.material;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Array of the available gravities.
|
||||
/// </summary>
|
||||
private Func<Transform, Transform, Vector3>[] gravityFunctions =
|
||||
{ DownGravity, UpGravity, NoGravity, InwardsGravity, OutwardsGravity };
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity zero vector.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> NoGravity =
|
||||
new((gravitySource, target) => new Vector3());
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector downwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> DownGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.down * _gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector upwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> UpGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.up * _gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector towards the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> InwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(target.position - gravitySource.position).normalized * -_gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector outwards from the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> OutwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(target.position - gravitySource.position).normalized * _gravityFactor);
|
||||
|
||||
public Func<Transform, Transform, Vector3> GetGravityFunction(Gravity gravity)
|
||||
{
|
||||
return gravityFunctions[(int)gravity];
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
forcesManager.SetGravityForInstance(instanceID, GetGravityFunction(_gravity), transform);
|
||||
material = meshRenderer.material;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
SetGravityEffect();
|
||||
GravityEffect.Play();
|
||||
}
|
||||
|
||||
private void SetGravityEffect()
|
||||
{
|
||||
var velocityLifetime = GravityEffect.velocityOverLifetime;
|
||||
var main = GravityEffect.main;
|
||||
var emission = GravityEffect.emission;
|
||||
switch (_gravity)
|
||||
{
|
||||
default:
|
||||
case Gravity.DownGravity:
|
||||
velocityLifetime.y = -1f;
|
||||
main.startLifetime = 1.5f;
|
||||
main.startSpeed = 0f;
|
||||
velocityLifetime.speedModifier = 5f;
|
||||
velocityLifetime.orbitalX = 0f;
|
||||
velocityLifetime.orbitalY = 0f;
|
||||
velocityLifetime.orbitalZ = 0f;
|
||||
break;
|
||||
case Gravity.UpGravity:
|
||||
velocityLifetime.y = 1f;
|
||||
main.startLifetime = 1.5f;
|
||||
main.startSpeed = 0f;
|
||||
velocityLifetime.speedModifier = 5f;
|
||||
velocityLifetime.orbitalX = 0f;
|
||||
velocityLifetime.orbitalY = 0f;
|
||||
velocityLifetime.orbitalZ = 0f;
|
||||
break;
|
||||
case Gravity.OutwardsGravity:
|
||||
velocityLifetime.y = 0;
|
||||
main.startLifetime = 1.5f;
|
||||
main.startSpeed = 1f;
|
||||
velocityLifetime.speedModifier = 2f;
|
||||
velocityLifetime.orbitalX = 0f;
|
||||
velocityLifetime.orbitalY = 0f;
|
||||
velocityLifetime.orbitalZ = 0f;
|
||||
break;
|
||||
case Gravity.InwardsGravity:
|
||||
velocityLifetime.y = 0;
|
||||
main.startLifetime = 1.5f;
|
||||
main.startSpeed = -1f;
|
||||
velocityLifetime.speedModifier = 1.5f;
|
||||
velocityLifetime.orbitalX = 0.5f;
|
||||
velocityLifetime.orbitalY = 0.5f;
|
||||
velocityLifetime.orbitalZ = 0.5f;
|
||||
break;
|
||||
case Gravity.NoGravity:
|
||||
main.startSpeed = 0f;
|
||||
velocityLifetime.y = 0;
|
||||
velocityLifetime.orbitalX = 0.2f;
|
||||
velocityLifetime.orbitalY = 0.2f;
|
||||
velocityLifetime.orbitalZ = 0.2f;
|
||||
main.startLifetime = 8f;
|
||||
emission.rateOverTime = 5;
|
||||
velocityLifetime.speedModifier = 1f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
var func = GetGravityFunction(_gravity);
|
||||
_forcesManager.SetGravityForInstance(instanceID, func, transform);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
material.SetFloat("_ShaderTime", Time.timeSinceLevelLoad);
|
||||
material.SetFloat("_ShaderTime", Time.timeSinceLevelLoad);
|
||||
}
|
||||
|
||||
private void ApplyZoneColor(MeshRenderer renderer)
|
||||
{
|
||||
Color color = _gravityColors[_gravity];
|
||||
MaterialPropertyBlock materialPropertyBlock = new();
|
||||
materialPropertyBlock.SetColor("_BaseColor", color);
|
||||
renderer.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void ApplyZoneColor(MeshRenderer renderer)
|
||||
{
|
||||
Color color = _gravityColors[_gravity];
|
||||
MaterialPropertyBlock materialPropertyBlock = new();
|
||||
materialPropertyBlock.SetColor("_BaseColor", color);
|
||||
renderer.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum Gravity
|
||||
{
|
||||
DownGravity, UpGravity, NoGravity, InwardsGravity, OutwardsGravity
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GravityColorEntry
|
||||
{
|
||||
public Gravity gravity;
|
||||
public Color color;
|
||||
}
|
||||
}
|
||||
91
Assets/Scripts/GravityHelpers.cs
Normal file
91
Assets/Scripts/GravityHelpers.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GravityFunctionality
|
||||
{
|
||||
/// <summary>
|
||||
/// Available types of gravity.
|
||||
/// Need to match the existing functions!
|
||||
/// </summary>
|
||||
public enum Gravity
|
||||
{
|
||||
DownGravity = 0, UpGravity = 1, NoGravity = 2, InwardsGravity = 3, OutwardsGravity = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializable mapping of a color to a gravity.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class GravityColorEntry
|
||||
{
|
||||
public Gravity gravity;
|
||||
public Color color;
|
||||
}
|
||||
|
||||
public static class GravityHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Function which returns a gravity zero vector.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> _noGravity =
|
||||
new((gravitySource, target) => new Vector3());
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector downwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> _downGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.down);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector upwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> _upGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.up);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector towards the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> _inwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(-target.position + gravitySource.position).normalized);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector outwards from the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> _outwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(target.position - gravitySource.position).normalized);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the gravity function belonging to the supplied gravity enum.
|
||||
/// </summary>
|
||||
/// <param name="gravity">Enum for the gravity function to get.</param>
|
||||
/// <returns>A gravity function</returns>
|
||||
public static Func<Transform, Transform, Vector3> GetGravityFunction(Gravity gravity)
|
||||
{
|
||||
switch (gravity)
|
||||
{
|
||||
case Gravity.DownGravity:
|
||||
return _downGravity;
|
||||
case Gravity.UpGravity:
|
||||
return _upGravity;
|
||||
case Gravity.NoGravity:
|
||||
return _noGravity;
|
||||
case Gravity.OutwardsGravity:
|
||||
return _outwardsGravity;
|
||||
case Gravity.InwardsGravity:
|
||||
return _inwardsGravity;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/GravityHelpers.cs.meta
Normal file
11
Assets/Scripts/GravityHelpers.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52f8b1b9fd91cbe42bce23425474a53a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -117,13 +117,13 @@ namespace Managers
|
||||
var MatchArena = MatchManager.G.MatchArena;
|
||||
List<Player> spawned = new List<Player>();
|
||||
|
||||
GameObject shipObject = Instantiate(player.character.shipPrefab);
|
||||
GameObject shipObject = Instantiate(player.character.ShipPrefab);
|
||||
player.spawnedCharacter = shipObject;
|
||||
shipObject.TryGetComponent(out PredictedShip ship);
|
||||
ship.props = player.character;
|
||||
ship.state = new ShipHandling.ShipState();
|
||||
ship.input = new ShipHandling.ShipInput();
|
||||
ApplyShipColor(player.character.shipHullColor, ship.bodyMeshRenderer);
|
||||
ApplyShipColor(player.character.ShipHullColor, ship.bodyMeshRenderer);
|
||||
ship.cameraOperator = MatchCamera.GetComponent<CameraOperator>();
|
||||
shipObject.transform.SetParent(MatchArena.transform, false);
|
||||
shipObject.transform.localPosition =
|
||||
@ -139,8 +139,8 @@ namespace Managers
|
||||
|
||||
public void SpawnCharacter(Player p, GameObject camera, GameObject arena)
|
||||
{
|
||||
Log.Debug($"Spawning ship:{p.character.shipName} for player: {p.playerName}");
|
||||
GameObject shipObject = Instantiate(p.character.shipPrefab);
|
||||
Log.Debug($"Spawning ship:{p.character.ShipName} for player: {p.playerName}");
|
||||
GameObject shipObject = Instantiate(p.character.ShipPrefab);
|
||||
Log.Debug($"Instantiated prefab");
|
||||
p.spawnedCharacter = shipObject;
|
||||
shipObject.TryGetComponent(out Ship ship);
|
||||
@ -148,7 +148,7 @@ namespace Managers
|
||||
ship.State = new ShipHandling.ShipState();
|
||||
ship.Input = new ShipHandling.ShipInput();
|
||||
ship.CameraOperator = camera.GetComponent<CameraOperator>();
|
||||
ApplyShipColor(p.character.shipHullColor, ship.BodyMeshRenderer);
|
||||
ApplyShipColor(p.character.ShipHullColor, ship.BodyMeshRenderer);
|
||||
Log.Debug($"Applied ships color");
|
||||
shipObject.transform.SetParent(arena.transform, false);
|
||||
shipObject.transform.localPosition =
|
||||
|
||||
@ -34,9 +34,9 @@ namespace Managers
|
||||
playersControlSchemes?.Clear();
|
||||
foreach (Player p in players)
|
||||
{
|
||||
if (p.character.shipInput != null)
|
||||
if (p.character.ShipInput != null)
|
||||
{
|
||||
ShipInputHandler input = p.character.shipInput;
|
||||
ShipInputHandler input = p.character.ShipInput;
|
||||
if (p.spawnedCharacter.TryGetComponent(out Ship ship))
|
||||
{
|
||||
input.ReActivateInput(ship);
|
||||
@ -121,7 +121,7 @@ namespace Managers
|
||||
|
||||
private void AssignShipControls(UniqueControl uc, ShipInput si, ShipProperties p)
|
||||
{
|
||||
p.shipInput = new ShipInputHandler(si,
|
||||
p.ShipInput = new ShipInputHandler(si,
|
||||
InputSystem.GetDeviceById(uc.DeviceId), uc.SchemeName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ namespace Managers
|
||||
Player updatedPlayer = null;
|
||||
foreach (Player p in PlayerManager.G.MatchPlayers)
|
||||
{
|
||||
if (p.character.shipName == update.Ship.Props.shipName)
|
||||
if (p.character.ShipName == update.Ship.Props.ShipName)
|
||||
{
|
||||
updatedPlayer = p;
|
||||
Log.Debug($"Players: {p.playerName}'s match statistic will be updated.");
|
||||
@ -154,7 +154,7 @@ namespace Managers
|
||||
}
|
||||
if (updatedPlayer == null)
|
||||
{
|
||||
Log.Error($"Ship: {update.Ship.Props.shipName} does not belong to a player in this match."
|
||||
Log.Error($"Ship: {update.Ship.Props.ShipName} does not belong to a player in this match."
|
||||
+ " Can't update match.");
|
||||
return;
|
||||
}
|
||||
@ -448,7 +448,7 @@ namespace Managers
|
||||
MatchCamera.GetComponent<CameraOperator>().AddCharacter(shipGO);
|
||||
ship.State.IsFrozen = false;
|
||||
|
||||
ship.State.boostCapacity = ship.Props.maxBoostCapacity;
|
||||
ship.State.boostCapacity = ship.Props.MaxBoostCapacity;
|
||||
|
||||
body.velocity = Vector3.zero;
|
||||
|
||||
|
||||
@ -2,277 +2,237 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Managers;
|
||||
using Unity.Mathematics;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using static AffectingForcesManager;
|
||||
using static GravityFunctionality.GravityHelpers;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class NimbleZone : MonoBehaviour
|
||||
namespace GravityFunctionality
|
||||
{
|
||||
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static Transform _nimbleZoneTransform;
|
||||
public AffectingForcesManager forcesManager;
|
||||
|
||||
public GameObject renderedZoneObject;
|
||||
[ExecuteInEditMode]
|
||||
public class NimbleZone : MonoBehaviour
|
||||
{
|
||||
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static Transform _nimbleZoneTransform;
|
||||
|
||||
[SerializeField]
|
||||
private List<GravityColorEntry> NimbleZoneColors = new();
|
||||
public GameObject renderedZoneObject;
|
||||
|
||||
private Dictionary<Gravity, Color> _nimbleZoneColors =
|
||||
new Dictionary<Gravity, Color>
|
||||
{
|
||||
[SerializeField]
|
||||
private List<GravityColorEntry> NimbleZoneColors = new();
|
||||
|
||||
private Dictionary<Gravity, Color> _nimbleZoneColors =
|
||||
new Dictionary<Gravity, Color>
|
||||
{
|
||||
{Gravity.DownGravity, Color.green },
|
||||
{Gravity.UpGravity, Color.magenta },
|
||||
{Gravity.NoGravity, Color.red },
|
||||
{Gravity.InwardsGravity, Color.blue },
|
||||
{Gravity.OutwardsGravity, Color.yellow },
|
||||
};
|
||||
};
|
||||
|
||||
[SerializeField]
|
||||
private static float gravityFactor = 30f;
|
||||
[SerializeField]
|
||||
private Gravity outsideGravityFunction = Gravity.NoGravity;
|
||||
[SerializeField]
|
||||
private Zone zone = Zone.NimbleZone;
|
||||
[SerializeField]
|
||||
private static float gravityFactor = 30f;
|
||||
[SerializeField]
|
||||
private Gravity outsideGravityFunction = Gravity.NoGravity;
|
||||
[SerializeField]
|
||||
private Zone zone = Zone.NimbleZone;
|
||||
|
||||
// Ripple properties
|
||||
// These influence the shader on the nimble zone
|
||||
[SerializeField]
|
||||
private float rippleFrequency = 3f;
|
||||
[SerializeField]
|
||||
private float rippleDensity = 30f;
|
||||
[SerializeField]
|
||||
private float rippleAmplitude = 0.1f;
|
||||
[SerializeField]
|
||||
private float rippleRadius = 1f;
|
||||
[SerializeField]
|
||||
private float rippleDuration = 1f;
|
||||
[SerializeField]
|
||||
private float impactVelocityModifier = 1f;
|
||||
[SerializeField, Tooltip("Minimum ripple effect intensity.")]
|
||||
[Range(0, 1)]
|
||||
private float minImpact = 0.2f;
|
||||
[SerializeField, Tooltip("Velocity which makes the highest/most intense ripples.")]
|
||||
private float maxVelocity = 45f;
|
||||
private int maxRippleAmount = 5;
|
||||
private MeshRenderer meshRenderer;
|
||||
private Material material;
|
||||
// Ripple properties
|
||||
// These influence the shader on the nimble zone
|
||||
[SerializeField]
|
||||
private float rippleFrequency = 3f;
|
||||
[SerializeField]
|
||||
private float rippleDensity = 30f;
|
||||
[SerializeField]
|
||||
private float rippleAmplitude = 0.1f;
|
||||
[SerializeField]
|
||||
private float rippleRadius = 1f;
|
||||
[SerializeField]
|
||||
private float rippleDuration = 1f;
|
||||
[SerializeField]
|
||||
private float impactVelocityModifier = 1f;
|
||||
[SerializeField, Tooltip("Minimum ripple effect intensity.")]
|
||||
[Range(0, 1)]
|
||||
private float minImpact = 0.2f;
|
||||
[SerializeField, Tooltip("Velocity which makes the highest/most intense ripples.")]
|
||||
private float maxVelocity = 45f;
|
||||
private AffectingForcesManager _forcesManager;
|
||||
private int maxRippleAmount = 5;
|
||||
private MeshRenderer meshRenderer;
|
||||
private Material material;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
foreach (GravityColorEntry entry in NimbleZoneColors)
|
||||
void Awake()
|
||||
{
|
||||
_nimbleZoneColors[entry.gravity] = entry.color;
|
||||
}
|
||||
meshRenderer = renderedZoneObject.GetComponent<MeshRenderer>();
|
||||
_nimbleZoneTransform = gameObject.transform;
|
||||
ApplyZoneColor(meshRenderer);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
|
||||
material = meshRenderer.material;
|
||||
ResetRippleShaderProperties();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Array of the available gravities.
|
||||
/// </summary>
|
||||
private Func<Transform, Transform, Vector3>[] gravityFunctions =
|
||||
{ DownGravity, UpGravity, NoGravity, InwardsGravity, OutwardsGravity };
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity zero vector.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> NoGravity =
|
||||
new((gravitySource, target) => new Vector3());
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector downwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> DownGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.down * gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector upwards, depending
|
||||
/// on the parent transforms rotation.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> UpGravity =
|
||||
new((gravitySource, target) =>
|
||||
gravitySource.rotation * Vector3.up * gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector towards the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> InwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(target.position - gravitySource.position).normalized * -gravityFactor);
|
||||
|
||||
/// <summary>
|
||||
/// Function which returns a gravity vector outwards from the center of the parenting transform.
|
||||
/// The parenting transform for a ship is the arena it's in.
|
||||
/// </summary>
|
||||
private static readonly Func<Transform, Transform, Vector3> OutwardsGravity =
|
||||
new((gravitySource, target) =>
|
||||
(target.position - gravitySource.position).normalized * gravityFactor);
|
||||
|
||||
public Func<Transform, Transform, Vector3> GetGravityFunction(Gravity gravity)
|
||||
{
|
||||
return gravityFunctions[(int)gravity];
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Spike"
|
||||
&& collider.attachedRigidbody.velocity.magnitude > 1)
|
||||
{
|
||||
SpawnRipple(collider, false);
|
||||
return;
|
||||
}
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
forcesManager.SetGravityForInstance(instanceID, NoGravity, transform);
|
||||
forcesManager.SetZoneForInstance(instanceID, zone);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Spike")
|
||||
{
|
||||
SpawnRipple(collider, true);
|
||||
return;
|
||||
}
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
forcesManager.SetGravityForInstance(instanceID,
|
||||
GetGravityFunction(outsideGravityFunction), transform);
|
||||
forcesManager.SetZoneForInstance(instanceID, Zone.OutsideZone);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
material.SetFloat("_ShaderTime", Time.timeSinceLevelLoad);
|
||||
}
|
||||
|
||||
private void ApplyZoneColor(MeshRenderer renderer)
|
||||
{
|
||||
Color color = _nimbleZoneColors[outsideGravityFunction];
|
||||
MaterialPropertyBlock materialPropertyBlock = new();
|
||||
materialPropertyBlock.SetColor("_BaseColor", color);
|
||||
renderer.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the effect which a given velocity has on a ripple property.
|
||||
/// </summary>
|
||||
/// <param name="duration">Initial value of the ripple property</param>
|
||||
/// <param name="velocity">Velocity of the impact</param>
|
||||
/// <returns></returns>
|
||||
private float ImpactVelocityEffect(float initial, float velocity)
|
||||
{
|
||||
return math.max(math.smoothstep(0, maxVelocity, velocity), minImpact)
|
||||
* impactVelocityModifier * initial;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawns ripples on the shader of the nimble zone.
|
||||
/// Up to 5 parallel ripples.
|
||||
/// </summary>
|
||||
/// <param name="collider"></param>
|
||||
/// <param name="isOutwardsRipple"></param>
|
||||
private void SpawnRipple(Collider collider, bool isOutwardsRipple)
|
||||
{
|
||||
Rigidbody body = collider.attachedRigidbody;
|
||||
GameObject gameObject = collider.gameObject;
|
||||
|
||||
float velocity = body.velocity.magnitude;
|
||||
Vector3 position = gameObject.transform.position - transform.position;
|
||||
position = transform.InverseTransformDirection(position).normalized;
|
||||
|
||||
Vector4[] rippleOrigins = material.GetVectorArray("_RippleOrigins");
|
||||
|
||||
float currentTime = Time.timeSinceLevelLoad;
|
||||
float[] startedTimes = material.GetFloatArray("_RippleStartTimes");
|
||||
float[] startedRippleDurations = material.GetFloatArray("_RippleDurations");
|
||||
|
||||
float[] rippleAmplitudes = material.GetFloatArray("_RippleAmplitudes");
|
||||
float[] rippleFrequencies = material.GetFloatArray("_RippleFrequencies");
|
||||
float[] rippleDensities = material.GetFloatArray("_RippleDensities");
|
||||
float[] rippleRadii = material.GetFloatArray("_RippleRadii");
|
||||
|
||||
if (startedTimes == null)
|
||||
{
|
||||
Log.Warn("Ripple shader properties are null. Reseting shader");
|
||||
ResetRippleShaderProperties();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < startedTimes.Length; ++i)
|
||||
{
|
||||
if (startedTimes[i] + startedRippleDurations[i] < currentTime)
|
||||
if (_forcesManager == null)
|
||||
{
|
||||
rippleOrigins[i] = new Vector4(position.x, position.y, position.z, 0);
|
||||
material.SetVectorArray("_RippleOrigins", rippleOrigins);
|
||||
startedTimes[i] = currentTime;
|
||||
material.SetFloatArray("_RippleStartTimes", startedTimes);
|
||||
_forcesManager = GameObject.FindGameObjectWithTag("ForceManager").
|
||||
GetComponent<AffectingForcesManager>();
|
||||
}
|
||||
foreach (GravityColorEntry entry in NimbleZoneColors)
|
||||
{
|
||||
_nimbleZoneColors[entry.gravity] = entry.color;
|
||||
}
|
||||
meshRenderer = renderedZoneObject.GetComponent<MeshRenderer>();
|
||||
_nimbleZoneTransform = gameObject.transform;
|
||||
ApplyZoneColor(meshRenderer);
|
||||
|
||||
float amplitude = isOutwardsRipple ? rippleAmplitude : -rippleAmplitude;
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
|
||||
rippleAmplitudes[i] = ImpactVelocityEffect(amplitude, velocity);
|
||||
rippleFrequencies[i] = ImpactVelocityEffect(rippleFrequency, velocity);
|
||||
rippleDensities[i] = ImpactVelocityEffect(rippleDensity, velocity);
|
||||
startedRippleDurations[i] = ImpactVelocityEffect(rippleDuration, velocity);
|
||||
rippleRadii[i] = ImpactVelocityEffect(rippleRadius, velocity);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleFrequencies", rippleFrequencies);
|
||||
material.SetFloatArray("_RippleDensities", rippleDensities);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleDurations", startedRippleDurations);
|
||||
material.SetFloatArray("_RippleRadii", rippleRadii);
|
||||
break;
|
||||
material = meshRenderer.material;
|
||||
ResetRippleShaderProperties();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Spike"
|
||||
&& collider.attachedRigidbody.velocity.magnitude > 1)
|
||||
{
|
||||
SpawnRipple(collider, false);
|
||||
return;
|
||||
}
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
var func = GetGravityFunction(Gravity.NoGravity);
|
||||
_forcesManager.SetGravityForInstance(instanceID, func, transform);
|
||||
_forcesManager.SetZoneForInstance(instanceID, zone);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider collider)
|
||||
{
|
||||
int instanceID = collider.gameObject.GetInstanceID();
|
||||
if (collider.tag == "Spike")
|
||||
{
|
||||
SpawnRipple(collider, true);
|
||||
return;
|
||||
}
|
||||
if (collider.tag == "Ship")
|
||||
{
|
||||
var func = GetGravityFunction(outsideGravityFunction);
|
||||
_forcesManager.SetGravityForInstance(instanceID, func, transform);
|
||||
_forcesManager.SetZoneForInstance(instanceID, Zone.OutsideZone);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying) return;
|
||||
#endif
|
||||
material.SetFloat("_ShaderTime", Time.timeSinceLevelLoad);
|
||||
}
|
||||
|
||||
private void ApplyZoneColor(MeshRenderer renderer)
|
||||
{
|
||||
Color color = _nimbleZoneColors[outsideGravityFunction];
|
||||
MaterialPropertyBlock materialPropertyBlock = new();
|
||||
materialPropertyBlock.SetColor("_BaseColor", color);
|
||||
renderer.SetPropertyBlock(materialPropertyBlock);
|
||||
}
|
||||
|
||||
#region RippleShader
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the effect which a given velocity has on a ripple property.
|
||||
/// </summary>
|
||||
/// <param name="duration">Initial value of the ripple property</param>
|
||||
/// <param name="velocity">Velocity of the impact</param>
|
||||
/// <returns></returns>
|
||||
private float ImpactVelocityEffect(float initial, float velocity)
|
||||
{
|
||||
return math.max(math.smoothstep(0, maxVelocity, velocity), minImpact)
|
||||
* impactVelocityModifier * initial;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawns ripples on the shader of the nimble zone.
|
||||
/// Up to 5 parallel ripples.
|
||||
/// </summary>
|
||||
/// <param name="collider"></param>
|
||||
/// <param name="isOutwardsRipple"></param>
|
||||
private void SpawnRipple(Collider collider, bool isOutwardsRipple)
|
||||
{
|
||||
Rigidbody body = collider.attachedRigidbody;
|
||||
GameObject gameObject = collider.gameObject;
|
||||
|
||||
float velocity = body.velocity.magnitude;
|
||||
Vector3 position = gameObject.transform.position - transform.position;
|
||||
position = transform.InverseTransformDirection(position).normalized;
|
||||
|
||||
Vector4[] rippleOrigins = material.GetVectorArray("_RippleOrigins");
|
||||
|
||||
float currentTime = Time.timeSinceLevelLoad;
|
||||
float[] startedTimes = material.GetFloatArray("_RippleStartTimes");
|
||||
float[] startedRippleDurations = material.GetFloatArray("_RippleDurations");
|
||||
|
||||
float[] rippleAmplitudes = material.GetFloatArray("_RippleAmplitudes");
|
||||
float[] rippleFrequencies = material.GetFloatArray("_RippleFrequencies");
|
||||
float[] rippleDensities = material.GetFloatArray("_RippleDensities");
|
||||
float[] rippleRadii = material.GetFloatArray("_RippleRadii");
|
||||
|
||||
if (startedTimes == null)
|
||||
{
|
||||
Log.Warn("Ripple shader properties are null. Reseting shader");
|
||||
ResetRippleShaderProperties();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < startedTimes.Length; ++i)
|
||||
{
|
||||
if (startedTimes[i] + startedRippleDurations[i] < currentTime)
|
||||
{
|
||||
rippleOrigins[i] = new Vector4(position.x, position.y, position.z, 0);
|
||||
material.SetVectorArray("_RippleOrigins", rippleOrigins);
|
||||
startedTimes[i] = currentTime;
|
||||
material.SetFloatArray("_RippleStartTimes", startedTimes);
|
||||
|
||||
float amplitude = isOutwardsRipple ? rippleAmplitude : -rippleAmplitude;
|
||||
|
||||
rippleAmplitudes[i] = ImpactVelocityEffect(amplitude, velocity);
|
||||
rippleFrequencies[i] = ImpactVelocityEffect(rippleFrequency, velocity);
|
||||
rippleDensities[i] = ImpactVelocityEffect(rippleDensity, velocity);
|
||||
startedRippleDurations[i] = ImpactVelocityEffect(rippleDuration, velocity);
|
||||
rippleRadii[i] = ImpactVelocityEffect(rippleRadius, velocity);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleFrequencies", rippleFrequencies);
|
||||
material.SetFloatArray("_RippleDensities", rippleDensities);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleDurations", startedRippleDurations);
|
||||
material.SetFloatArray("_RippleRadii", rippleRadii);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the ripple shaders exposed properties to 0
|
||||
/// </summary>
|
||||
private void ResetRippleShaderProperties()
|
||||
{
|
||||
Vector4[] rippleOrigins = new Vector4[maxRippleAmount];
|
||||
float[] startedTimes = new float[maxRippleAmount];
|
||||
float[] rippleAmplitudes = new float[maxRippleAmount];
|
||||
float[] rippleFrequencies = new float[maxRippleAmount];
|
||||
float[] rippleDensities = new float[maxRippleAmount];
|
||||
float[] rippleDurations = new float[maxRippleAmount];
|
||||
float[] rippleRadii = new float[maxRippleAmount];
|
||||
|
||||
// Initialize Ripple Shader Properties
|
||||
material.SetVectorArray("_RippleOrigins", rippleOrigins);
|
||||
material.SetFloatArray("_RippleStartTimes", startedTimes);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleFrequencies", rippleFrequencies);
|
||||
material.SetFloatArray("_RippleDensities", rippleDensities);
|
||||
material.SetFloatArray("_RippleDurations", rippleDurations);
|
||||
material.SetFloatArray("_RippleRadii", rippleRadii);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the ripple shaders exposed properties to 0
|
||||
/// </summary>
|
||||
private void ResetRippleShaderProperties()
|
||||
{
|
||||
Vector4[] rippleOrigins = new Vector4[maxRippleAmount];
|
||||
float[] startedTimes = new float[maxRippleAmount];
|
||||
float[] rippleAmplitudes = new float[maxRippleAmount];
|
||||
float[] rippleFrequencies = new float[maxRippleAmount];
|
||||
float[] rippleDensities = new float[maxRippleAmount];
|
||||
float[] rippleDurations = new float[maxRippleAmount];
|
||||
float[] rippleRadii = new float[maxRippleAmount];
|
||||
|
||||
// Initialize Ripple Shader Properties
|
||||
material.SetVectorArray("_RippleOrigins", rippleOrigins);
|
||||
material.SetFloatArray("_RippleStartTimes", startedTimes);
|
||||
material.SetFloatArray("_RippleAmplitudes", rippleAmplitudes);
|
||||
material.SetFloatArray("_RippleFrequencies", rippleFrequencies);
|
||||
material.SetFloatArray("_RippleDensities", rippleDensities);
|
||||
material.SetFloatArray("_RippleDurations", rippleDurations);
|
||||
material.SetFloatArray("_RippleRadii", rippleRadii);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -25,7 +25,7 @@ public class BoostCapacityUI : MonoBehaviour
|
||||
|
||||
public void SetPlayerName(Player p)
|
||||
{
|
||||
hint.SetText($"{p.playerName}\n{p.character.shipName}");
|
||||
hint.SetText($"{p.playerName}\n{p.character.ShipName}");
|
||||
}
|
||||
|
||||
public void SetIsOut(Player p)
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
"com.unity.feature.development": "1.0.1",
|
||||
"com.unity.ide.visualstudio": "2.0.22",
|
||||
"com.unity.inputsystem": "1.7.0",
|
||||
"com.unity.nuget.newtonsoft-json": "3.2.1",
|
||||
"com.unity.postprocessing": "3.4.0",
|
||||
"com.unity.render-pipelines.universal": "14.0.10",
|
||||
"com.unity.textmeshpro": "3.0.8",
|
||||
|
||||
@ -136,6 +136,13 @@
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.nuget.newtonsoft-json": {
|
||||
"version": "3.2.1",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.performance.profile-analyzer": {
|
||||
"version": "1.2.2",
|
||||
"depth": 1,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user