新增动态水物理插件

This commit is contained in:
Bob.Song
2026-02-27 17:44:21 +08:00
parent a6e061d9ce
commit 60744d113d
2218 changed files with 698551 additions and 189 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bd1127ae640c7fe4db7c6079e55a0ec3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,815 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &94578620
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.x
value: 59.749313
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.y
value: 0.3567614
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.z
value: 52.5689
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.w
value: -0.055562973
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49813923
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.y
value: -0.02549261
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.z
value: -0.8649394
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0.64500004
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 59.838
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -186.98
objectReference: {fileID: 0}
- target: {fileID: 1458920470670619411, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Name
value: Barrel
objectReference: {fileID: 0}
- target: {fileID: 8926922743088943369, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
--- !u!1 &97097260
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 97097261}
- component: {fileID: 97097263}
- component: {fileID: 97097262}
m_Layer: 0
m_Name: Input
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &97097261
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97097260}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -13.632792, y: -5.0323358, z: 14.027246}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &97097262
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97097260}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9c48880c19d04dabb53da07d15024184, type: 3}
m_Name:
m_EditorClassIdentifier:
requireCameraPanningModifier: 1
requireCameraRotationModifier: 1
--- !u!114 &97097263
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97097260}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 977b3558370da85488b8199c446577a0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &373752550
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.x
value: 71.20064
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.y
value: 0.3567614
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.z
value: 19.151974
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.w
value: -0.055562973
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49813923
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.y
value: -0.02549261
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.z
value: -0.8649394
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0.64500004
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 59.838
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -186.98
objectReference: {fileID: 0}
- target: {fileID: 1458920470670619411, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Name
value: Barrel (2)
objectReference: {fileID: 0}
- target: {fileID: 8926922743088943369, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
--- !u!1 &704538600
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 704538601}
- component: {fileID: 704538602}
m_Layer: 0
m_Name: WaterDataProvider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &704538601
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 704538600}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 55.000004, y: 3.4099998, z: 43.235012}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &704538602
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 704538600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 056adf6db685b1f45b7ed7d684b1443a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1522384058
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalPosition.x
value: 65.63054
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalPosition.y
value: 0.26
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalPosition.z
value: 35.478622
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9997711
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalRotation.x
value: 0.021396097
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalRotation.y
value: -0.000048101345
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalRotation.z
value: 0.00021032862
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 2.4520001
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -0.0050000004
objectReference: {fileID: 0}
- target: {fileID: 9080636920400647041, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0.024
objectReference: {fileID: 0}
- target: {fileID: 9084893953822647005, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9085998900156301991, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
propertyPath: m_Name
value: MotorBoat
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cc49f32d2370da340abb3b1c8ae5921b, type: 3}
--- !u!1 &1527235759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1527235761}
- component: {fileID: 1527235760}
m_Layer: 0
m_Name: Ocean
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1527235760
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1527235759}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c051a435f6c61e143a579931f862085e, type: 3}
m_Name:
m_EditorClassIdentifier:
WindSpeed: 7.3
WindRotation: 122
WindTurbulence: 0.096
TimeScale: 1
FftWavesQuality: 256
FftWavesCascades: 4
WavesAreaScale: 1
WindZone: {fileID: 0}
WindZoneSpeedMultiplier: 1
WindZoneTurbulenceMultiplier: 1
OceanFoam: 0
FoamTextureType: 1
FoamTextureContrast: 2.25
FoamTextureScaleMultiplier: 1
OceanFoamStrength: 0.2
OceanFoamLifetimeMultiplier: 0.9
--- !u!4 &1527235761
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1527235759}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1844549186
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1844549188}
- component: {fileID: 1844549187}
m_Layer: 4
m_Name: Water Manager (Global Settings)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1844549187
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1844549186}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93eb560ae5ebcd8459ef03cd3eccbd16, type: 3}
m_Name:
m_EditorClassIdentifier:
Transparent: 4.3
WaterColor: {r: 1, g: 1, b: 1, a: 1}
TurbidityColor: {r: 0.02745098, g: 0.25490198, b: 0.3137255, a: 1}
ScreenSpaceReflection: 0
PlanarReflection: 0
AnisotropicReflectionsScale: 0.5
OverrideSkyColor: 0
CustomSkyColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
ReflectSun: 1
ReflectedSunCloudinessStrength: 0.04
ReflectedSunStrength: 1
RefractionMode: 0
RefractionSimpleStrength: 0.057
RefractionDispersion: 1
RefractionDispersionStrength: 0.35
WetEffect: 0
WetStrength: 1
WetnessHeightAboveWater: 2
WetDecalLayerMask:
serializedVersion: 0
m_Bits: 1
VolumetricLighting: 0
VolumetricLightTemporalReprojectionAccumulationFactor: 0.35
VolumetricLightUseBlur: 0
VolumetricLightBlurRadius: 2
VolumetricLightCausticMode: 0
CausticEffect: 0
CausticStrength: 2.5
OceanCausticDispersionStrength: 1
DisableCausticsInShadow: 0
UnderwaterEffect: 0
UnderwaterReflectionMode: 1
UseUnderwaterHalfLineTensionEffect: 1
UseWaterDropsEffect: 1
WaterDropsEffectTimeScale: 1
UnderwaterHalfLineTensionScale: 0.5
OverrideUnderwaterTransparent: 0
UnderwaterTransparentOffset: 5
ShowColorSettings: 0
ShowReflectionSettings: 0
ShowRefractionSettings: 0
ShowWetSettings: 0
ShowVolumetricSettings: 0
ShowCausticEffectSettings: 0
ShowUnderwaterEffectSettings: 0
ShowRenderingSettings: 0
AutoUpdateIntersections: 1
--- !u!4 &1844549188
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1844549186}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1989611837
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1989611839}
- component: {fileID: 1989611838}
- component: {fileID: 1989611840}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1989611838
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1989611837}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &1989611839
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1989611837}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &1989611840
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1989611837}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0
--- !u!1001 &2078542305
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.x
value: 76.21179
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.y
value: 0.3567614
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.z
value: 44.949665
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.w
value: -0.055562973
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49813923
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.y
value: -0.02549261
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.z
value: -0.8649394
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0.64500004
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 59.838
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -186.98
objectReference: {fileID: 0}
- target: {fileID: 1458920470670619411, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Name
value: Barrel (1)
objectReference: {fileID: 0}
- target: {fileID: 8926922743088943369, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
--- !u!1001 &2144668171
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.x
value: 68.48197
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.y
value: 0.3567614
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalPosition.z
value: 56.497253
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.w
value: -0.055562973
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.x
value: -0.49813923
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.y
value: -0.02549261
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalRotation.z
value: -0.8649394
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0.64500004
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 59.838
objectReference: {fileID: 0}
- target: {fileID: 1453323137386053793, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: -186.98
objectReference: {fileID: 0}
- target: {fileID: 1458920470670619411, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Name
value: Barrel (3)
objectReference: {fileID: 0}
- target: {fileID: 8926922743088943369, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6c178052f07cdce4abd234d7738cd4a1, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1989611839}
- {fileID: 704538601}
- {fileID: 97097261}
- {fileID: 1844549188}
- {fileID: 1527235761}
- {fileID: 94578620}
- {fileID: 2078542305}
- {fileID: 373752550}
- {fileID: 2144668171}
- {fileID: 1522384058}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c59d34e1949f1ad4f828ceafcffe18c0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,183 @@
// ╔════════════════════════════════════════════════════════════════╗
// ║ Copyright © 2025 NWH Coding d.o.o. All rights reserved. ║
// ║ Licensed under Unity Asset Store Terms of Service: ║
// ║ https://unity.com/legal/as-terms ║
// ║ Use permitted only in compliance with the License. ║
// ║ Distributed "AS IS", without warranty of any kind. ║
// ╚════════════════════════════════════════════════════════════════╝
using KWS;
using NWH.DWP2.WaterObjects;
using UnityEngine;
using System.Collections.Generic;
namespace NWH.DWP2.WaterData
{
/// <summary>
/// KWS only supports one active request at a time. This provider batches all WaterObject
/// queries into a single request per frame, then distributes results back.
/// </summary>
[DefaultExecutionOrder(-50)]
public class KWSWaterDataProvider : WaterDataProvider
{
// Single shared request for batch queries
private WaterSurfaceRequestArray _request = new WaterSurfaceRequestArray();
// Separate request for single-point queries (Engine.Submerged, etc.)
private WaterSurfaceRequestArray _singleRequest = new WaterSurfaceRequestArray();
private Vector3[] _singlePointArray = new Vector3[1];
private float _lastSingleHeight;
// Double-buffered batching: collect current frame, submit previous frame
private List<Vector3> _currentPoints = new List<Vector3>();
private List<Vector3> _pendingPoints = new List<Vector3>();
private List<(int id, int start, int count)> _currentRanges = new List<(int, int, int)>();
private List<(int id, int start, int count)> _pendingRanges = new List<(int, int, int)>();
// Cached results per WaterObject
private Dictionary<int, (float[] heights, Vector3[] flows, bool valid)> _cachedResults
= new Dictionary<int, (float[], Vector3[], bool)>();
public override bool SupportsWaterHeightQueries() => true;
public override bool SupportsWaterNormalQueries() => false;
public override bool SupportsWaterFlowQueries() => true;
// Override to prevent single-point queries from corrupting batch cache
public override float GetWaterHeightSingle(WaterObject waterObject, Vector3 point)
{
_singlePointArray[0] = point;
_singleRequest.SetNewPositions(_singlePointArray);
WaterSystem.TryGetWaterSurfaceData(_singleRequest);
if (_singleRequest.IsDataReady)
{
_lastSingleHeight = _singleRequest.Result[0].Position.y;
}
return _lastSingleHeight;
}
private void FixedUpdate()
{
// Check if pending request has results
if (_pendingPoints.Count > 0 && _request.IsDataReady)
{
DistributeResults();
}
// Submit current batch (becomes pending)
if (_currentPoints.Count > 0)
{
// Swap buffers
(_currentPoints, _pendingPoints) = (_pendingPoints, _currentPoints);
(_currentRanges, _pendingRanges) = (_pendingRanges, _currentRanges);
_request.SetNewPositions(_pendingPoints.ToArray());
WaterSystem.TryGetWaterSurfaceData(_request);
}
// Clear current for new collection
_currentPoints.Clear();
_currentRanges.Clear();
}
public override void GetWaterHeights(WaterObject waterObject, ref Vector3[] points, ref float[] waterHeights)
{
int id = waterObject.instanceID;
// Add this WaterObject's points to current batch
int startIndex = _currentPoints.Count;
for (int i = 0; i < points.Length; i++)
{
_currentPoints.Add(points[i]);
}
_currentRanges.Add((id, startIndex, points.Length));
// Ensure cache exists and is large enough (only grow, never shrink)
if (!_cachedResults.TryGetValue(id, out var cached) ||
cached.heights == null || cached.heights.Length < points.Length)
{
_cachedResults[id] = (new float[points.Length], new Vector3[points.Length], false);
cached = _cachedResults[id];
}
// Return cached values
if (cached.valid)
{
int count = Mathf.Min(cached.heights.Length, waterHeights.Length);
for (int i = 0; i < count; i++)
{
waterHeights[i] = cached.heights[i];
}
}
}
private void DistributeResults()
{
var results = _request.Result;
if (results == null) return;
// Use pending ranges (matches the pending request that just completed)
foreach (var (id, start, count) in _pendingRanges)
{
if (!_cachedResults.TryGetValue(id, out var cached)) continue;
if (start >= results.Length) continue;
var heights = cached.heights;
var flows = cached.flows;
int resultCount = Mathf.Min(count, results.Length - start);
for (int i = 0; i < resultCount; i++)
{
heights[i] = results[start + i].Position.y;
flows[i] = results[start + i].Velocity;
}
_cachedResults[id] = (heights, flows, true);
}
}
public override void GetWaterFlows(WaterObject waterObject, ref Vector3[] points, ref Vector3[] waterFlows)
{
int id = waterObject.instanceID;
if (!_cachedResults.TryGetValue(id, out var cached) || !cached.valid || cached.flows == null)
return;
int count = Mathf.Min(cached.flows.Length, waterFlows.Length);
for (int i = 0; i < count; i++)
{
waterFlows[i] = cached.flows[i];
}
}
}
}
#if UNITY_EDITOR
namespace NWH.DWP2.WaterData
{
using UnityEditor;
[CustomEditor(typeof(KWSWaterDataProvider))]
[CanEditMultipleObjects]
public class KWSWaterDataProviderEditor : WaterDataProviderEditor
{
protected override void DrawStatus(WaterDataProvider provider)
{
drawer.BeginSubsection("Status");
bool hasWaterSystem = WaterSystem.Instance != null;
if (hasWaterSystem)
{
drawer.Info("KWS Water System found in scene.");
}
else
{
drawer.Info("KWS Water System not found in scene.", MessageType.Warning);
}
drawer.EndSubsection();
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 056adf6db685b1f45b7ed7d684b1443a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
{
"name": "NWH.DWP2.Integration.KWS",
"rootNamespace": "",
"references": [
"GUID:19db8fea26d333b429867702a7138f47",
"GUID:75ecb28acc33857438e533566abcb3be",
"GUID:c76e28da8ce572043b1fb2da95817e18"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0094d657fd383e248bab577c42dee924
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: