提交火山情绪视觉基础
This commit is contained in:
@@ -846,7 +846,8 @@ MonoBehaviour:
|
||||
- {fileID: 8662106111246897391}
|
||||
- {fileID: 7564190746689473555}
|
||||
- {fileID: 3316319638873422484}
|
||||
m_RendererFeatureMap: 53e73d20cf257bd5ef909c479dfb3578130cb9456867f96894bab31424ef052e
|
||||
- {fileID: 3859429700647655299}
|
||||
m_RendererFeatureMap: 53e73d20cf257bd5ef909c479dfb3578130cb9456867f96894bab31424ef052e8317b256dd728f35
|
||||
m_UseNativeRenderPass: 0
|
||||
m_TransparencySortMode: 0
|
||||
m_TransparencySortAxis: {x: 0, y: 1, z: 0}
|
||||
@@ -1758,6 +1759,19 @@ MonoBehaviour:
|
||||
- {fileID: 2800000, guid: 4b292ed3be6030a46b692cd4a6618fce, type: 3}
|
||||
- {fileID: 2800000, guid: e5a866cc090f56e4ba639cea6678767a, type: 3}
|
||||
- {fileID: 2800000, guid: a6de4c4d850aff74ea58994f8d761c2d, type: 3}
|
||||
--- !u!114 &3859429700647655299
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 729a2e952309e2547a3747b2cdd9a36f, type: 3}
|
||||
m_Name: ShapesRenderFeature
|
||||
m_EditorClassIdentifier:
|
||||
m_Active: 1
|
||||
--- !u!114 &3861612574892562831
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
|
||||
@@ -0,0 +1,430 @@
|
||||
%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: 9
|
||||
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: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 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_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
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_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 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!1 &472731661
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 472731664}
|
||||
- component: {fileID: 472731663}
|
||||
- component: {fileID: 472731662}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &472731662
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 472731661}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 70bdc08d6a69fcc489e789073881b5c5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
useCullingMasks: 0
|
||||
fieldSize: 6.47
|
||||
pointCount: 25
|
||||
pointSize: 0.05
|
||||
lineWidth: 0.01
|
||||
noiseScale: 0.52
|
||||
waveHeight: 0.71
|
||||
waveSpeed: 0.2
|
||||
timeScale: 1
|
||||
radialFrequency: 0.5
|
||||
radialStrength: 1
|
||||
--- !u!114 &472731663
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 472731661}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: efc77758b3964bb47b33d516c7e80f62, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
useCullingMasks: 0
|
||||
lineThickness: 0.0066
|
||||
lineColor: {r: 0, g: 1, b: 0.24640584, a: 1}
|
||||
seed: 0
|
||||
lineCount: 100
|
||||
branchesMin: 1
|
||||
branchesMax: 5
|
||||
branchLengthMin: 0.25
|
||||
branchLengthMax: 1
|
||||
maxAngDeviation: 1.0471976
|
||||
use3D: 0
|
||||
--- !u!4 &472731664
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 472731661}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.0485426, y: 3.0641944, z: -2.6293025}
|
||||
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 &519420028
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 519420032}
|
||||
- component: {fileID: 519420031}
|
||||
- component: {fileID: 519420029}
|
||||
- component: {fileID: 519420030}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &519420029
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &519420030
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_RenderShadows: 1
|
||||
m_RequiresDepthTextureOption: 2
|
||||
m_RequiresOpaqueTextureOption: 2
|
||||
m_CameraType: 0
|
||||
m_Cameras: []
|
||||
m_RendererIndex: -1
|
||||
m_VolumeLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
m_VolumeTrigger: {fileID: 0}
|
||||
m_VolumeFrameworkUpdateModeOption: 2
|
||||
m_RenderPostProcessing: 0
|
||||
m_Antialiasing: 0
|
||||
m_AntialiasingQuality: 2
|
||||
m_StopNaN: 0
|
||||
m_Dithering: 0
|
||||
m_ClearDepth: 1
|
||||
m_AllowXRRendering: 1
|
||||
m_AllowHDROutput: 1
|
||||
m_UseScreenCoordOverride: 0
|
||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
quality: 3
|
||||
frameInfluence: 0.1
|
||||
jitterScale: 1
|
||||
mipBias: 0
|
||||
varianceClampScale: 0.9
|
||||
contrastAdaptiveSharpening: 0
|
||||
--- !u!20 &519420031
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 34
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 0
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &519420032
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.3970472, y: -0.006888179, z: 0.0029810548, w: 0.9177675}
|
||||
m_LocalPosition: {x: 0.019188061, y: 7.2175875, z: -6.8352437}
|
||||
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 &619394800
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 619394802}
|
||||
- component: {fileID: 619394801}
|
||||
m_Layer: 0
|
||||
m_Name: Global Light 2D
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &619394801
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ComponentVersion: 1
|
||||
m_LightType: 4
|
||||
m_BlendStyleIndex: 0
|
||||
m_FalloffIntensity: 0.5
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: 1
|
||||
m_LightVolumeIntensity: 1
|
||||
m_LightVolumeIntensityEnabled: 0
|
||||
m_ApplyToSortingLayers: 00000000
|
||||
m_LightCookieSprite: {fileID: 0}
|
||||
m_DeprecatedPointLightCookieSprite: {fileID: 0}
|
||||
m_LightOrder: 0
|
||||
m_AlphaBlendOnOverlap: 0
|
||||
m_OverlapOperation: 0
|
||||
m_NormalMapDistance: 3
|
||||
m_NormalMapQuality: 2
|
||||
m_UseNormalMap: 0
|
||||
m_ShadowIntensityEnabled: 0
|
||||
m_ShadowIntensity: 0.75
|
||||
m_ShadowVolumeIntensityEnabled: 0
|
||||
m_ShadowVolumeIntensity: 0.75
|
||||
m_LocalBounds:
|
||||
m_Center: {x: 0, y: -0.00000011920929, z: 0}
|
||||
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
|
||||
m_PointLightInnerAngle: 360
|
||||
m_PointLightOuterAngle: 360
|
||||
m_PointLightInnerRadius: 0
|
||||
m_PointLightOuterRadius: 1
|
||||
m_ShapeLightParametricSides: 5
|
||||
m_ShapeLightParametricAngleOffset: 0
|
||||
m_ShapeLightParametricRadius: 1
|
||||
m_ShapeLightFalloffSize: 0.5
|
||||
m_ShapeLightFalloffOffset: {x: 0, y: 0}
|
||||
m_ShapePath:
|
||||
- {x: -0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: 0.5, z: 0}
|
||||
- {x: -0.5, y: 0.5, z: 0}
|
||||
--- !u!4 &619394802
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
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!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 619394802}
|
||||
- {fileID: 472731664}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85d2d28057fa50d419186d2f0c1f82ee
|
||||
TextScriptImporter:
|
||||
guid: b0870ff3b9020364cb3dd8aba273bbba
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
@@ -0,0 +1,157 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Shapes;
|
||||
|
||||
[ExecuteAlways]
|
||||
[RequireComponent(typeof(MeshCollider))]
|
||||
public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
{
|
||||
[Header("场设置")]
|
||||
public float fieldSize = 20f;
|
||||
public int pointCount = 30;
|
||||
public float pointSize = 0.15f;
|
||||
public float lineWidth = 0.03f;
|
||||
|
||||
[Header("波动参数")]
|
||||
public float noiseScale = 0.3f;
|
||||
public float waveHeight = 1.5f;
|
||||
public float waveSpeed = 1f;
|
||||
public float timeScale = 1f;
|
||||
|
||||
[Header("涟漪参数")]
|
||||
public float rippleStrength = 1.5f;
|
||||
public float rippleRadius = 2f;
|
||||
public float rippleDuration = 2f;
|
||||
|
||||
private Vector3[] points;
|
||||
private float time;
|
||||
|
||||
// 涟漪记录
|
||||
private List<Vector2> rippleCenters = new List<Vector2>();
|
||||
private List<float> rippleTimes = new List<float>();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// 运行中才响应点击
|
||||
if (Application.isPlaying && Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
if (Physics.Raycast(ray, out RaycastHit hit))
|
||||
{
|
||||
// 将点击点转换为局部坐标
|
||||
Vector3 localPos = transform.InverseTransformPoint(hit.point);
|
||||
rippleCenters.Add(new Vector2(localPos.x, localPos.z));
|
||||
rippleTimes.Add(time);
|
||||
}
|
||||
}
|
||||
|
||||
// 清除过时涟漪
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
for (int i = rippleCenters.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (time - rippleTimes[i] > rippleDuration)
|
||||
{
|
||||
rippleCenters.RemoveAt(i);
|
||||
rippleTimes.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float GetNoise(float x, float z, float t)
|
||||
{
|
||||
float noise = 0f;
|
||||
float amp = 1f;
|
||||
float freq = 1f;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
float nx = x * freq * noiseScale;
|
||||
float nz = z * freq * noiseScale;
|
||||
float nt = t * waveSpeed * freq;
|
||||
noise += Mathf.PerlinNoise(nx + nt, nz + nt) * amp;
|
||||
amp *= 0.5f;
|
||||
freq *= 2f;
|
||||
}
|
||||
|
||||
float ripple = 0f;
|
||||
for (int i = 0; i < rippleCenters.Count; i++)
|
||||
{
|
||||
Vector2 center = rippleCenters[i];
|
||||
float rippleTime = t - rippleTimes[i];
|
||||
if (rippleTime > rippleDuration) continue;
|
||||
|
||||
float dist = Vector2.Distance(new Vector2(x, z), center);
|
||||
if (dist > rippleRadius) continue;
|
||||
|
||||
float nd = dist / rippleRadius;
|
||||
float rippleVal = Mathf.Sin((1f - nd) * Mathf.PI * 2f - rippleTime * 4f) * (1f - nd);
|
||||
ripple += rippleVal * rippleStrength * (1f - rippleTime / rippleDuration);
|
||||
}
|
||||
|
||||
return (noise + ripple) * waveHeight;
|
||||
}
|
||||
|
||||
public override void DrawShapes(Camera cam)
|
||||
{
|
||||
using (Draw.Command(cam))
|
||||
{
|
||||
time = Application.isPlaying ? Time.time * timeScale : 0f;
|
||||
|
||||
Draw.ResetAllDrawStates();
|
||||
Draw.LineGeometry = LineGeometry.Volumetric3D;
|
||||
Draw.Thickness = lineWidth;
|
||||
Draw.Color = Color.cyan;
|
||||
|
||||
float step = fieldSize / (pointCount - 1);
|
||||
float half = fieldSize * 0.5f;
|
||||
|
||||
if (points == null || points.Length != pointCount * pointCount)
|
||||
points = new Vector3[pointCount * pointCount];
|
||||
|
||||
for (int i = 0; i < pointCount; i++)
|
||||
{
|
||||
for (int j = 0; j < pointCount; j++)
|
||||
{
|
||||
float x = -half + j * step;
|
||||
float z = -half + i * step;
|
||||
float y = GetNoise(x, z, time);
|
||||
points[i * pointCount + j] = new Vector3(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < pointCount; i++)
|
||||
{
|
||||
for (int j = 0; j < pointCount; j++)
|
||||
{
|
||||
int index = i * pointCount + j;
|
||||
Vector3 current = points[index];
|
||||
|
||||
float depth = (current.y + waveHeight) / (waveHeight * 2f);
|
||||
float scale = pointSize * (1f - depth * 0.5f);
|
||||
Color pointColor = Color.Lerp(new Color(0.5f, 1f, 1f), new Color(0f, 0.3f, 1f, 0.5f), depth);
|
||||
|
||||
Draw.Sphere(current, scale, pointColor);
|
||||
|
||||
if (j < pointCount - 1)
|
||||
{
|
||||
Vector3 next = points[index + 1];
|
||||
float avgY = (current.y + next.y) * 0.5f;
|
||||
float lineDepth = (avgY + waveHeight) / (waveHeight * 2f);
|
||||
Color lineColor = Color.Lerp(Color.cyan, new Color(0, 0.5f, 1f, 0.3f), lineDepth);
|
||||
Draw.Line(current, next, lineWidth * (1f - lineDepth * 0.5f), lineColor);
|
||||
}
|
||||
|
||||
if (i < pointCount - 1)
|
||||
{
|
||||
Vector3 next = points[index + pointCount];
|
||||
float avgY = (current.y + next.y) * 0.5f;
|
||||
float lineDepth = (avgY + waveHeight) / (waveHeight * 2f);
|
||||
Color lineColor = Color.Lerp(Color.cyan, new Color(0, 0.5f, 1f, 0.3f), lineDepth);
|
||||
Draw.Line(current, next, lineWidth * (1f - lineDepth * 0.5f), lineColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70bdc08d6a69fcc489e789073881b5c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,7 +5,7 @@ using Shapes;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
public class LakeWaveGrid : ImmediateModeShapeDrawer
|
||||
[ExecuteAlways]public class LakeWaveGrid : ImmediateModeShapeDrawer
|
||||
{
|
||||
public int gridSize = 32;
|
||||
public float spacing = 0.2f;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -752,7 +752,8 @@ MonoBehaviour:
|
||||
m_RendererFeatures:
|
||||
- {fileID: 8662106111246897391}
|
||||
- {fileID: -4061060882956187341}
|
||||
m_RendererFeatureMap: ef909c479dfb3578338929b4a436a4c7
|
||||
- {fileID: 1577696406140154068}
|
||||
m_RendererFeatureMap: ef909c479dfb3578338929b4a436a4c7d4f064bb851ae515
|
||||
m_UseNativeRenderPass: 0
|
||||
m_TransparencySortMode: 0
|
||||
m_TransparencySortAxis: {x: 0, y: 1, z: 0}
|
||||
@@ -825,6 +826,19 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
_active: 1
|
||||
_shader: {fileID: 4800000, guid: 7197a098de6065f4ab8a580c8f8c7226, type: 3}
|
||||
--- !u!114 &1577696406140154068
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 729a2e952309e2547a3747b2cdd9a36f, type: 3}
|
||||
m_Name: ShapesRenderFeature
|
||||
m_EditorClassIdentifier:
|
||||
m_Active: 1
|
||||
--- !u!114 &1953936319933055606
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
|
||||
@@ -18,7 +18,8 @@ MonoBehaviour:
|
||||
m_RendererData: {fileID: 0}
|
||||
m_RendererDataList:
|
||||
- {fileID: 11400000, guid: dca52c8292bb8ca4e8356f4acb098a88, type: 2}
|
||||
m_DefaultRendererIndex: 0
|
||||
- {fileID: 11400000, guid: 96e75e36cf232784c9c06f3d204eef90, type: 2}
|
||||
m_DefaultRendererIndex: 1
|
||||
m_RequireDepthTexture: 0
|
||||
m_RequireOpaqueTexture: 0
|
||||
m_OpaqueDownsampling: 1
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user