Compare commits

2 Commits
main ... wip

Author SHA1 Message Date
9fd4e13d34 feat: Event & Teleporter 2026-11-03 22:58:10 +01:00
a7e8ef1a1f feat: Player & Camera 2026-10-08 15:12:19 +02:00
48 changed files with 6430 additions and 72 deletions

View File

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

View File

@@ -0,0 +1,141 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1820602765338096021
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: M_Heal
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 2
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 1
- _DstBlendAlpha: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 1
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.10849059, g: 1, b: 0.26741007, a: 1}
- _Color: {r: 0.108490564, g: 1, b: 0.26741004, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 65d8dad5bb4bf714db3e64463937c982
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: M_WorldGrid
m_Shader: {fileID: 4800000, guid: 0b6b65e03c0cbc6458620f24738fd6c6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _CrossOpacity: 1
- _CrossSize: 0.13
- _CrossWidth: 0.02
- _DotDiameter: 0.009
- _DotOpacity: 0.22
- _GridOpacity: 0.28
- _GridWidth: 0.001
- _Metallic: 0
- _Smoothness: 0.3
- _TriplanarSharpness: 16
m_Colors:
- _BaseColor: {r: 0.21493416, g: 0.26285714, b: 0.2830189, a: 1}
- _DarkColor: {r: 0.035, g: 0.054999977, b: 0.06999998, a: 1}
- _LineColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0ddabcd6e8573c4a8e4e0d1378495ac
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/_Content/Models/Gun.fbx LFS Normal file

Binary file not shown.

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 0e4d319eaf75fc24dac24e27d167ce9a
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 100
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 0c0ea1e86f9450642966454d2baaebee
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 100
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,294 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1147726563735334551
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7556724015060411566}
- component: {fileID: 3783306422223445236}
- component: {fileID: 8275237195305215234}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7556724015060411566
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1147726563735334551}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 9.3132e-10, y: 0.000000059605, z: 0}
m_LocalScale: {x: 0.52297795, y: 0.16915, z: 0.16915}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2066137184867944858}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3783306422223445236
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1147726563735334551}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8275237195305215234
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1147726563735334551}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 65d8dad5bb4bf714db3e64463937c982, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &3212408836776066074
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2066137184867944858}
- component: {fileID: 3170361717976852070}
- component: {fileID: 1618082476748621181}
- component: {fileID: 6580930266284447471}
m_Layer: 0
m_Name: Heal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2066137184867944858
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212408836776066074}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.008, y: 0.742, z: -3.21385}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7556724015060411566}
- {fileID: 2719514837664179606}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &3170361717976852070
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212408836776066074}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1618082476748621181
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212408836776066074}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d3c874cb9bc4c364d87e100aada2b434, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Arena.Characters.PlayerEvent
_settings:
Trigger: 0
_onPlayer:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 6580930266284447471}
m_TargetAssemblyTypeName: Arena.Interactions.HealEffect, Assembly-CSharp
m_MethodName: Apply
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 3212408836776066074}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &6580930266284447471
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212408836776066074}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5e30510fdd4a8b64da1115732d8ee972, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Arena.Interactions.HealEffect
_settings:
Amount: 25
--- !u!1 &3382438918099537360
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2719514837664179606}
- component: {fileID: 4326274491252777190}
- component: {fileID: 2540956898591381309}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2719514837664179606
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3382438918099537360}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 9.3132e-10, y: 0.000000059605, z: 0}
m_LocalScale: {x: 0.52297795, y: 0.16915, z: 0.16915}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2066137184867944858}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!33 &4326274491252777190
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3382438918099537360}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2540956898591381309
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3382438918099537360}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 65d8dad5bb4bf714db3e64463937c982, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3d06280fd07b03740829c858344b95e9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -1,13 +0,0 @@
using UnityEngine;
[ExecuteAlways]
public class CameraFollower : MonoBehaviour
{
public GameObject Player;
void Update()
{
if (Player)
transform.position = Player.transform.position;
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 4ae4fbdc595247448b3d604825bd07fe

View File

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

View File

@@ -0,0 +1,186 @@
using Arena.Combat;
using System;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Arena.Characters
{
public class Player : MonoBehaviour, IDamageable
{
[System.Serializable]
private class Settings
{
[Tooltip("Movement speed, in km/h.")]
public float Speed = 10;
}
[System.Serializable]
private struct References
{
public CharacterController Controller;
public InputActionReference MoveAction;
public InputActionReference InteractAction;
}
[System.Serializable]
public class StateContainer
{
public bool IsMoving = false;
}
#region FIELDS
public static Player Instance { get; private set; }
const float KMH_TO_MS = 1 / 3.6f;
[SerializeField] private Settings _settings;
[SerializeField] private References _references;
[SerializeField] private StateContainer _state;
[SerializeField] private Health _health;
public Action OnInteract;
public StateContainer State => _state;
public Health Health => _health;
private bool _isInteracting;
private Vector2 _moveInput;
private Camera _camera;
#endregion
#region UNITY LIFECYCLES
void Awake()
{
if (Instance && Instance != this)
{
Debug.LogWarning($"A second Player was found on {name}, it is destroyed.");
Destroy(gameObject);
return;
}
Instance = this;
_health.Initialize();
_camera = Camera.main;
}
void OnEnable()
{
_references.MoveAction.action.Enable();
_references.InteractAction.action.Enable();
}
void OnDisable()
{
if (Instance == this)
{
_references.MoveAction.action.Disable();
_references.InteractAction.action.Disable();
}
}
void OnDestroy()
{
if (Instance == this)
Instance = null;
}
void Update()
{
if (_health.IsDead)
return;
float t = Time.deltaTime;
GetInputs();
Move(t);
Interact();
}
#endregion
#region PUBLIC METHODS
public void TakeDamage(int amount)
{
_health.TakeDamage(amount);
}
// <summary>
/// Teleports the player.
/// </summary>
/// <param name="pose">x, y, z: position. w: angle around the vertical axis, in degrees.</param>
public void Teleport(Vector4 pose)
{
// An enabled CharacterController would overwrite the new position
_references.Controller.enabled = false;
Vector3 position = new Vector3(pose.x, pose.y, pose.z);
Quaternion rotation = Quaternion.Euler(0f, pose.w, 0f);
transform.SetPositionAndRotation(position, rotation);
_references.Controller.enabled = true;
}
/// <summary>
/// Teleports the player to the position and heading of a target, such as a spawn point.
/// </summary>
public void Teleport(Transform target)
{
Vector3 position = target.position;
Vector4 pose = new Vector4(position.x, position.y, position.z, target.eulerAngles.y);
Teleport(pose);
}
#endregion
#region PRIVATE METHODS
#if UNITY_EDITOR
[ContextMenu("Debug/Take 25 Damage")]
private void DebugTakeDamage()
{
TakeDamage(25);
}
#endif
private void GetInputs()
{
_moveInput = _references.MoveAction.action.ReadValue<Vector2>();
_isInteracting = _references.InteractAction.action.WasPressedThisFrame();
}
private void Move(float t)
{
Vector3 direction = ToWorldDirection(_moveInput);
Vector3 velocity = direction * KMH_TO_MS * _settings.Speed;
_state.IsMoving = velocity.sqrMagnitude > .01f;
_references.Controller.Move(velocity * t);
}
private void Interact()
{
if (_isInteracting)
{
OnInteract?.Invoke();
}
}
private Vector3 ToWorldDirection(Vector2 input)
{
// Only the camera rotation around the vertical axis is kept
Quaternion cameraHeading = Quaternion.Euler(0f, _camera.transform.eulerAngles.y, 0f);
return cameraHeading * new Vector3(input.x, 0f, input.y);
}
#endregion
}
}

View File

@@ -0,0 +1,75 @@
using UnityEngine;
using UnityEngine.InputSystem;
namespace Arena.Characters
{
[ExecuteAlways]
public class PlayerCamera : MonoBehaviour
{
[System.Serializable]
public class Settings
{
[Tooltip("x: horizontal distance from the player, y: height above the player, in meters.")]
public Vector2 Offset = new Vector2(7f, 8f);
[Tooltip("Rotation of the offset around the player, in degrees.")]
public float Angle = 0f;
[Tooltip("Time to catch up with the player, in seconds. 0: no smoothing.")]
[Range(0f, 1f)] public float Smooth = 0.2f;
}
[System.Serializable]
private struct References
{
public Player Player;
}
#region FIELDS
[SerializeField] private Settings _settings;
[SerializeField] private References _references;
private Vector3 _velocity;
#endregion
void Update()
{
if (!GetPlayer())
return;
Vector3 targetPos = GetTargetPosition();
if (!Application.isPlaying || _settings.Smooth == 0)
{
transform.position = targetPos;
}
else
{
transform.position = Vector3.SmoothDamp(transform.position, targetPos, ref _velocity, _settings.Smooth);
}
}
private bool GetPlayer()
{
if (_references.Player)
return true;
// In edit mode, Player.Awake has not run, so the singleton is empty
else if (Player.Instance)
_references.Player = Player.Instance;
else
_references.Player = FindFirstObjectByType<Player>();
return _references.Player != null;
}
private Vector3 GetTargetPosition()
{
Quaternion rotation = Quaternion.Euler(0, _settings.Angle, 0);
Vector3 offset = rotation * new Vector3(0, _settings.Offset.y, -_settings.Offset.x);
return _references.Player.transform.position + offset;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bd78e931d0126914e8206e9f6bb2b9de

View File

@@ -0,0 +1,89 @@
using UnityEngine;
using UnityEngine.Events;
namespace Arena.Characters
{
public class PlayerEvent : MonoBehaviour
{
public enum Trigger
{
OnPlayerEnter,
OnPlayerInteract
}
[System.Serializable]
public class Settings
{
[Tooltip("OnPlayerEnter: as soon as the player enters. OnPlayerInteract: when the player interacts inside the zone.")]
public Trigger Trigger;
}
[SerializeField] private Settings _settings;
[SerializeField] private UnityEvent _onPlayer;
private bool _isListening;
#region UNITY LIFECYCLES
private void OnDisable()
{
// The object can be hidden while the player is inside
StopListening();
}
void OnTriggerEnter(Collider other)
{
if (!IsPlayer(other))
return;
if (_settings.Trigger == Trigger.OnPlayerEnter)
_onPlayer.Invoke();
else
StartListening();
}
void OnTriggerExit(Collider other)
{
if (IsPlayer(other))
StopListening();
}
#endregion
private bool IsPlayer(Collider other)
{
return Player.Instance != null && other.gameObject == Player.Instance.gameObject;
}
private void StartListening()
{
Player.Instance.OnInteract += HandleInteract;
_isListening = true;
}
private void StopListening()
{
if (!_isListening)
return;
if (Player.Instance != null)
Player.Instance.OnInteract -= HandleInteract;
_isListening = false;
}
private void HandleInteract()
{
_onPlayer.Invoke();
}
public void Teleport(Transform target)
{
if (!Player.Instance)
return;
StopListening();
Player.Instance.Teleport(target);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d3c874cb9bc4c364d87e100aada2b434

View File

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

View File

@@ -0,0 +1,83 @@
using System;
using UnityEngine;
namespace Arena.Combat
{
/// <summary>
/// Health points of an entity. Serialized inside the component that owns it (Player, Enemy),
/// which calls Initialize in its Awake.
/// </summary>
[System.Serializable]
public class Health
{
#region Fields
[Tooltip("Health points when full.")]
[Min(1)] public int Max = 100;
[Tooltip("Current health points, visible for debugging.")]
[SerializeField] private int _current;
/// <summary>
/// Raised with the current and max health points each time they change.
/// </summary>
public event Action<int, int> OnChange;
/// <summary>
/// Raised once, when the health points reach zero.
/// </summary>
public event Action OnDied;
public int Current => _current;
public bool IsDead => _current <= 0;
#endregion
#region Public Methods
/// <summary>
/// Fills the health points. Called by the owner in its Awake.
/// </summary>
public void Initialize()
{
SetCurrent(Max);
}
/// <summary>
/// Removes health points and raises OnDied the first time they reach zero.
/// </summary>
public void TakeDamage(int amount)
{
if (IsDead || amount <= 0)
return;
SetCurrent(_current - amount);
if (IsDead)
OnDied?.Invoke();
}
/// <summary>
/// Gives health points back without exceeding Max. Has no effect once dead.
/// </summary>
public void Heal(int amount)
{
if (IsDead || amount <= 0)
return;
SetCurrent(_current + amount);
}
#endregion
#region Private Methods
private void SetCurrent(int value)
{
_current = Mathf.Clamp(value, 0, Max);
OnChange?.Invoke(_current, Max);
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 220d6096ae28c12449f72c38860cbc2e

View File

@@ -0,0 +1,10 @@
namespace Arena.Combat
{
/// <summary>
/// Anything that can receive damage: player, enemy, destructible object.
/// </summary>
public interface IDamageable
{
void TakeDamage(int amount);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 14df4410feff3d044afb4ec552a18997

View File

@@ -0,0 +1,68 @@
using UnityEngine;
namespace Arena.Combat
{
/// <summary>
/// Moves straight ahead and damages the first IDamageable it touches.
/// Needs a trigger collider and a kinematic Rigidbody.
/// </summary>
[RequireComponent(typeof(Rigidbody))]
public class Projectile : MonoBehaviour
{
[System.Serializable]
public class Settings
{
[Tooltip("Speed, in meters per second.")]
[Min(0f)] public float Speed = 20f;
[Tooltip("Time before an unused projectile is destroyed, in seconds.")]
[Min(0.1f)] public float Lifetime = 2f;
}
#region Fields
[SerializeField] private Settings _settings;
private int _damage;
private GameObject _owner;
#endregion
#region Unity Lifecycle
private void Update()
{
transform.position += transform.forward * _settings.Speed * Time.deltaTime;
}
private void OnTriggerEnter(Collider other)
{
// Ignore the shooter and the other trigger zones
if (other.isTrigger || other.gameObject == _owner)
return;
if (other.TryGetComponent(out IDamageable target))
target.TakeDamage(_damage);
Destroy(gameObject);
}
#endregion
#region Public Methods
/// <summary>
/// Starts the projectile. Called right after Instantiate by whoever fires it.
/// </summary>
/// <param name="damage">Damage dealt to the IDamageable it touches.</param>
/// <param name="owner">Shooter, ignored by the projectile.</param>
public void Launch(int damage, GameObject owner)
{
_damage = damage;
_owner = owner;
Destroy(gameObject, _settings.Lifetime);
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 875f6e6257f7027489dceee7bdfec3cb

View File

@@ -0,0 +1,16 @@
using UnityEngine;
public class ProjectileLauncher : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4bb53e2fd0884a746883755fca366194

View File

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

View File

@@ -0,0 +1,34 @@
using UnityEngine;
using Arena.Characters;
namespace Arena.Interactions
{
/// <summary>
/// Heals the player. Apply is meant to be linked to a PlayerEvent.
/// </summary>
public class HealEffect : MonoBehaviour
{
[System.Serializable]
public class Settings
{
[Tooltip("Hit points given to the player.")]
[Min(1)] public int Amount = 25;
}
#region Fields
[SerializeField] private Settings _settings;
#endregion
#region Public Methods
public void Apply()
{
if (Player.Instance != null)
Player.Instance.Health.Heal(_settings.Amount);
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5e30510fdd4a8b64da1115732d8ee972

View File

@@ -1,53 +0,0 @@
using System.ComponentModel;
using UnityEngine;
public class PlayerMover : MonoBehaviour
{
[System.Serializable]
private class Settings
{
public float Speed = 5;
}
[System.Serializable]
private struct References
{
public CharacterController Controller;
}
[System.Serializable]
public class StateContainer
{
public bool IsJumping = false;
}
#region FIELDS
const float MS_TO_KMH = 1 / 3.6f;
[SerializeField] private Settings _settings;
[SerializeField] private References _references;
[SerializeField] private StateContainer _state;
public StateContainer State => _state;
#endregion
#region UNITY LIFECYCLES
void Update()
{
float t = Time.deltaTime;
Move(t);
}
private void Move(float t)
{
transform.position += Vector3.forward * t * MS_TO_KMH * _settings.Speed;
}
#endregion
}

View File

@@ -342,6 +342,9 @@ MonoBehaviour:
skyOcclusionIntensityMultiplier: skyOcclusionIntensityMultiplier:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 1 m_Value: 1
worldOffset:
m_OverrideState: 1
m_Value: {x: 0, y: 0, z: 0}
--- !u!114 &-1216621516061285780 --- !u!114 &-1216621516061285780
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@@ -376,6 +379,9 @@ MonoBehaviour:
highQualityFiltering: highQualityFiltering:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0 m_Value: 0
filter:
m_OverrideState: 1
m_Value: 0
downscale: downscale:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0 m_Value: 0
@@ -462,8 +468,6 @@ MonoBehaviour:
- {fileID: -6288072647309666549} - {fileID: -6288072647309666549}
- {fileID: 7518938298396184218} - {fileID: 7518938298396184218}
- {fileID: -1410297666881709256} - {fileID: -1410297666881709256}
- {fileID: -7750755424749557576}
- {fileID: -5139089513906902183}
--- !u!114 &853819529557874667 --- !u!114 &853819529557874667
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3

View File

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

View File

@@ -0,0 +1,538 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "8504e9bdabaf4858997e0f525ace7671",
"m_Properties": [],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "4e543fd3878a42db99418edc6edf0ba7"
}
],
"m_Nodes": [
{
"m_Id": "19d5cde9bfd8498a98dfc456a2a085b1"
},
{
"m_Id": "e46b92cb9c79432ca46eefa55eea0043"
},
{
"m_Id": "c51d56e4e95d417c832024b0e3582d74"
},
{
"m_Id": "95bb1e764bc14e08b5f94efbfc1a97b5"
},
{
"m_Id": "148e107b4a514638a85d1f65db6aebac"
},
{
"m_Id": "ea01fc94eed749579737ce9b4803b1c3"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "ea01fc94eed749579737ce9b4803b1c3"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "95bb1e764bc14e08b5f94efbfc1a97b5"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": [
{
"m_Id": "19d5cde9bfd8498a98dfc456a2a085b1"
},
{
"m_Id": "e46b92cb9c79432ca46eefa55eea0043"
},
{
"m_Id": "c51d56e4e95d417c832024b0e3582d74"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "95bb1e764bc14e08b5f94efbfc1a97b5"
},
{
"m_Id": "148e107b4a514638a85d1f65db6aebac"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "7fb196b850694ad892148a99a6dffeec"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "148e107b4a514638a85d1f65db6aebac",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Alpha",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "4de0a3d4e4ca4fbf85285f307e5e2ff2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "19d5cde9bfd8498a98dfc456a2a085b1",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "35ff8e602c8d46b891f390ae4294bbcf"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "297cd0d2b1ef498a83391eaa84d8b072",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "35ff8e602c8d46b891f390ae4294bbcf",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "4a8625d5d941403f92438a453b958880",
"m_Id": 2,
"m_DisplayName": "Out_Vector3",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "OutVector3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "4de0a3d4e4ca4fbf85285f307e5e2ff2",
"m_Id": 0,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "4e543fd3878a42db99418edc6edf0ba7",
"m_Name": "",
"m_ChildObjectList": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "5c1c7786040548c594595692ea8eabc7",
"m_Id": 1165641570,
"m_DisplayName": "Quality",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "_Quality",
"m_StageCapability": 3,
"m_Value": 1.0,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "7fa4a7becdef4ac590742fb8b6061f0d",
"m_Id": 1495779657,
"m_DisplayName": "Blur",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "_Blur",
"m_StageCapability": 3,
"m_Value": 0.5,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "7fb196b850694ad892148a99a6dffeec",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "f0490127bd8c4166bbfde748a359a2a1"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 1,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_DisableTint": false,
"m_Sort3DAs2DCompatible": false,
"m_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "95bb1e764bc14e08b5f94efbfc1a97b5",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "297cd0d2b1ef498a83391eaa84d8b072"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "c51d56e4e95d417c832024b0e3582d74",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "e715a6d1d83442d8a88ec92f40f1a4f7"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "d57890460fbb4bcca92d64b60520129c",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "e46b92cb9c79432ca46eefa55eea0043",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "d57890460fbb4bcca92d64b60520129c"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "e715a6d1d83442d8a88ec92f40f1a4f7",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SubGraphNode",
"m_ObjectId": "ea01fc94eed749579737ce9b4803b1c3",
"m_Group": {
"m_Id": ""
},
"m_Name": "Scene Blur",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -448.0,
"y": 179.0,
"width": 208.0,
"height": 303.0
}
},
"m_Slots": [
{
"m_Id": "7fa4a7becdef4ac590742fb8b6061f0d"
},
{
"m_Id": "5c1c7786040548c594595692ea8eabc7"
},
{
"m_Id": "4a8625d5d941403f92438a453b958880"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"26f47ae7ba9ee5943993a305e6779681\",\n \"type\": 3\n }\n}",
"m_PropertyGuids": [
"8063cb26-80fc-4286-8ad3-84a319514638",
"f6d871c3-eb20-4419-80ff-cb790122708e"
],
"m_PropertyIds": [
1495779657,
1165641570
],
"m_Dropdowns": [],
"m_DropdownSelectedEntries": []
}
{
"m_SGVersion": 2,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
"m_ObjectId": "f0490127bd8c4166bbfde748a359a2a1",
"m_KeepLightingVariants": false,
"m_DefaultDecalBlending": true,
"m_DefaultSSAO": true
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: abd46789b404b1b4c92524cc6a1766ae
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 0
exposeTemplateAsShader: 0
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}

View File

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

View File

@@ -0,0 +1,82 @@
#ifndef BLUR_INCLUDED
#define BLUR_INCLUDED
// Declare the texture only when the required macros exist.
#if defined(TEXTURE2D_X) && defined(SAMPLE_TEXTURE2D_X)
#define BLUR_TEXTURE_AVAILABLE 1
TEXTURE2D_X(_CameraOpaqueTexture);
SAMPLER(sampler_CameraOpaqueTexture);
#else
#define BLUR_TEXTURE_AVAILABLE 0
#endif
void Gaussian_float(float2 UV, float Blur, float Quality, out float3 Color)
{
#if defined(SHADERGRAPH_PREVIEW) || !BLUR_TEXTURE_AVAILABLE
Color = float3(0.5, 0.5, 0.5);
#else
float2 screenUV = saturate(UV);
float radius = saturate(Blur) * 0.04;
float2 stepUV = radius * float2(
_ScreenParams.y / _ScreenParams.x,
1.0
);
// LOW: 9 samples
// MEDIUM: 25 samples
// HIGH: 49 samples
int extent = (int)clamp(floor(Quality + 0.5), 0.0, 2.0) + 1;
float sigma = max(0.8, extent * 0.65);
float invTwoSigmaSq = 0.5 / (sigma * sigma);
float3 sum = 0.0;
float totalWeight = 0.0;
[loop]
for (int y = -extent; y <= extent; ++y)
{
[loop]
for (int x = -extent; x <= extent; ++x)
{
float2 offset = float2(x, y);
float weight = exp2(
-dot(offset, offset)
* invTwoSigmaSq
* 1.44269504089
);
float2 sampleUV = saturate(
screenUV + offset * stepUV / extent
);
float3 sampleColor = SAMPLE_TEXTURE2D_X(
_CameraOpaqueTexture,
sampler_CameraOpaqueTexture,
sampleUV
).rgb;
sum += sampleColor * weight;
totalWeight += weight;
}
}
Color = sum / max(totalWeight, 1e-5);
#endif
}
void Gaussian_half(half2 UV, half Blur, half Quality, out half3 Color)
{
float3 result;
Gaussian_float(
(float2) UV,
(float) Blur,
(float) Quality,
result
);
Color = (half3) result;
}
#endif

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 90c8bd5f68510954a8e1367627d7b9fd
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,576 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "9d1e9ebe2d9747ffa894412dfba72a33",
"m_Properties": [
{
"m_Id": "a4404a0972384ad1b4438a72f39e7991"
},
{
"m_Id": "62c93e885ac547e4bba6e1c78f616037"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "bf2f39d82e934286ae4a5374c1fd2c11"
}
],
"m_Nodes": [
{
"m_Id": "cf35d42ff38940b281c6ce2c8551a1cb"
},
{
"m_Id": "49fc354b55884d1abb7603ae085af83b"
},
{
"m_Id": "984a27fbc926447f87cd710107f68787"
},
{
"m_Id": "cb1666b04adb496dab93487a150fe810"
},
{
"m_Id": "8df27a4c7fda4aad9ef4fb2ddfc7d4b2"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "49fc354b55884d1abb7603ae085af83b"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "984a27fbc926447f87cd710107f68787"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "8df27a4c7fda4aad9ef4fb2ddfc7d4b2"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "984a27fbc926447f87cd710107f68787"
},
"m_SlotId": 3
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "984a27fbc926447f87cd710107f68787"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "cf35d42ff38940b281c6ce2c8551a1cb"
},
"m_SlotId": 2
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "cb1666b04adb496dab93487a150fe810"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "984a27fbc926447f87cd710107f68787"
},
"m_SlotId": 1
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Sub Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": "cf35d42ff38940b281c6ce2c8551a1cb"
},
"m_SubDatas": [],
"m_ActiveTargets": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "29f51427a77b4ebd8b35573100ab1e06",
"m_Id": 0,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode",
"m_ObjectId": "49fc354b55884d1abb7603ae085af83b",
"m_Group": {
"m_Id": ""
},
"m_Name": "Screen Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -361.0,
"y": 39.0,
"width": 208.0,
"height": 312.0
}
},
"m_Slots": [
{
"m_Id": "29f51427a77b4ebd8b35573100ab1e06"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_ScreenSpaceType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "62100b5c2cdb420ea029c63cee7e388a",
"m_Id": 2,
"m_DisplayName": "Out_Vector3",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "OutVector3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "62c93e885ac547e4bba6e1c78f616037",
"m_Guid": {
"m_GuidSerialized": "f6d871c3-eb20-4419-80ff-cb790122708e"
},
"promotedFromAssetID": "",
"promotedFromCategoryName": "",
"promotedOrdering": -1,
"m_Name": "Quality",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Quality",
"m_DefaultReferenceName": "_Quality",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_PerRendererData": false,
"m_customAttributes": [],
"m_Value": 1.0,
"m_FloatType": 0,
"m_LiteralFloatMode": false,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
},
"m_SliderType": 0,
"m_SliderPower": 3.0,
"m_EnumType": 0,
"m_CSharpEnumString": "",
"m_EnumNames": [
"Default"
],
"m_EnumValues": [
0
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "8ac0d8698d6f4355b69979a51fc1b149",
"m_Id": 0,
"m_DisplayName": "Quality",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "8df27a4c7fda4aad9ef4fb2ddfc7d4b2",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -153.0,
"y": 204.0,
"width": 112.0,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "8ac0d8698d6f4355b69979a51fc1b149"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "62c93e885ac547e4bba6e1c78f616037"
}
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
"m_ObjectId": "984a27fbc926447f87cd710107f68787",
"m_Group": {
"m_Id": ""
},
"m_Name": "Gaussian (Custom Function)",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -11.999992370605469,
"y": 84.00000762939453,
"width": 206.00003051757813,
"height": 142.0
}
},
"m_Slots": [
{
"m_Id": "c436f3daf0a148b684e2c91bdf25e93f"
},
{
"m_Id": "bb16fada7c80423abd415edd1ce3a4b6"
},
{
"m_Id": "c43f8eede482495c9425f224477cc565"
},
{
"m_Id": "9cb83bc7c5c046d2b3abca081e990cbc"
}
],
"synonyms": [
"code",
"HLSL"
],
"m_Precision": 0,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SourceType": 0,
"m_FunctionName": "Gaussian",
"m_FunctionSource": "90c8bd5f68510954a8e1367627d7b9fd",
"m_FunctionSourceUsePragmas": true,
"m_FunctionBody": "Enter function body here..."
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "9cb83bc7c5c046d2b3abca081e990cbc",
"m_Id": 3,
"m_DisplayName": "Quality",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Quality",
"m_StageCapability": 3,
"m_Value": 2.0,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "a4404a0972384ad1b4438a72f39e7991",
"m_Guid": {
"m_GuidSerialized": "8063cb26-80fc-4286-8ad3-84a319514638"
},
"promotedFromAssetID": "",
"promotedFromCategoryName": "",
"promotedOrdering": -1,
"m_Name": "Blur",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Blur",
"m_DefaultReferenceName": "_Blur",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_PerRendererData": false,
"m_customAttributes": [],
"m_Value": 0.5,
"m_FloatType": 0,
"m_LiteralFloatMode": false,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
},
"m_SliderType": 0,
"m_SliderPower": 3.0,
"m_EnumType": 0,
"m_CSharpEnumString": "",
"m_EnumNames": [
"Default"
],
"m_EnumValues": [
0
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
"m_ObjectId": "bb16fada7c80423abd415edd1ce3a4b6",
"m_Id": 0,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "bf2f39d82e934286ae4a5374c1fd2c11",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "a4404a0972384ad1b4438a72f39e7991"
},
{
"m_Id": "62c93e885ac547e4bba6e1c78f616037"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "c436f3daf0a148b684e2c91bdf25e93f",
"m_Id": 2,
"m_DisplayName": "Color",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Color",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "c43f8eede482495c9425f224477cc565",
"m_Id": 1,
"m_DisplayName": "Blur",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Blur",
"m_StageCapability": 3,
"m_Value": 1.0,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "cb1666b04adb496dab93487a150fe810",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -137.0,
"y": 161.0,
"width": 96.0,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "d8c308401ebb4d45aabcb025efd14753"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "a4404a0972384ad1b4438a72f39e7991"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
"m_ObjectId": "cf35d42ff38940b281c6ce2c8551a1cb",
"m_Group": {
"m_Id": ""
},
"m_Name": "Output",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 252.0000457763672,
"y": 83.9999771118164,
"width": 119.00001525878906,
"height": 77.0000228881836
}
},
"m_Slots": [
{
"m_Id": "62100b5c2cdb420ea029c63cee7e388a"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"IsFirstSlotValid": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "d8c308401ebb4d45aabcb025efd14753",
"m_Id": 0,
"m_DisplayName": "Blur",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [],
"m_LiteralMode": false
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 26f47ae7ba9ee5943993a305e6779681
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
documentationPath:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 57626961be12583439d7170a477a46ef
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 0
exposeTemplateAsShader: 0
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}

View File

@@ -0,0 +1,322 @@
Shader "Coiriergraphics/WorldGrid"
{
Properties
{
[MainColor] _BaseColor ("ColorA", Color) = (0.105, 0.17, 0.22, 1)
_LineColor ("ColorB", Color) = (1, 1, 1, 1)
_DarkColor ("ColorC", Color) = (0.035, 0.055, 0.07, 1)
_Metallic ("Metallic", Range(0, 1)) = 0
_Smoothness ("Smoothness", Range(0, 1)) = 0.3
}
SubShader
{
Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" }
LOD 300
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
CBUFFER_START(UnityPerMaterial)
half4 _BaseColor;
half4 _LineColor;
half4 _DarkColor;
half _Metallic;
half _Smoothness;
CBUFFER_END
// Fixed pattern settings (meters, after object scale compensation).
#define TRIPLANAR_SHARPNESS 16.0
#define DOT_SPACING 0.2
#define DOT_DIAMETER 0.026
#define DOT_DARKEN 0.30
#define DOT_FADE_START 1.5
#define DOT_FADE_END 5.0
#define GRID_WIDTH 0.008
#define GRID_DARKEN 0.45
#define MAJOR_GRID_WIDTH 0.015
#define MAJOR_GRID_OPACITY 0.20
#define CROSS_ARM_LENGTH 0.0425
#define CROSS_WIDTH 0.014
#define MAJOR_CROSS_ARM_LENGTH 0.14
#define MAJOR_CROSS_WIDTH 0.040
#define CROSS_OPACITY 0.11875
// Anti-alias the edge, but NEVER inflate tiny shapes by the full pixel
// footprint. That was turning the crosses into huge white squares.
float Stroke(float distanceToCenter, float halfWidth, float pixelWidth)
{
float edge = max(min(pixelWidth * 0.5, halfWidth * 0.5), 0.000001);
return 1.0 - smoothstep(halfWidth - edge, halfWidth + edge, distanceToCenter);
}
// x = dots, y = 1m grid, z = 4m major grid, w = small crosses.
// Larger 4m crosses are returned separately so they can force the full pattern color.
float4 Pattern2D(float2 p, out float majorCrossMask)
{
float2 pixel = max(fwidth(p), float2(0.000001, 0.000001));
float footprint = max(pixel.x, pixel.y);
float2 dotIndex = floor(p / DOT_SPACING + 0.5);
float2 dotLocal = p - dotIndex * DOT_SPACING;
float dotMask = Stroke(length(dotLocal), DOT_DIAMETER * 0.5, length(pixel));
// Entire dot rows and columns coinciding with a 1m grid line are absent.
// This avoids visible circles straddling thin lines (even with AA).
float2 distanceToGridIndex = abs((frac(dotIndex / 5.0 + 0.5) - 0.5) * 5.0);
dotMask *= step(0.5, min(distanceToGridIndex.x, distanceToGridIndex.y));
// Remove sub-pixel dots rather than allowing them to alias or expand.
dotMask *= 1.0 - smoothstep(0.004, 0.014, footprint);
float2 cell = frac(p + 0.5) - 0.5;
float2 gridDist = abs(cell);
float gridMask = max(
Stroke(gridDist.x, GRID_WIDTH * 0.5, pixel.x),
Stroke(gridDist.y, GRID_WIDTH * 0.5, pixel.y));
gridMask *= 1.0 - smoothstep(0.025, 0.10, footprint);
float2 majorDist = abs((frac(p / 4.0 + 0.5) - 0.5) * 4.0);
float majorMask = max(
Stroke(majorDist.x, MAJOR_GRID_WIDTH * 0.5, pixel.x),
Stroke(majorDist.y, MAJOR_GRID_WIDTH * 0.5, pixel.y));
// True plus signs: intersect two thin, finite line segments.
float horizontal = Stroke(abs(cell.y), CROSS_WIDTH * 0.5, pixel.y)
* Stroke(abs(cell.x), CROSS_ARM_LENGTH, pixel.x);
float vertical = Stroke(abs(cell.x), CROSS_WIDTH * 0.5, pixel.x)
* Stroke(abs(cell.y), CROSS_ARM_LENGTH, pixel.y);
float crossMask = max(horizontal, vertical);
// Suppress the ENTIRE cross at 1m intersections located on 4m lines.
// Using the nearest integer grid intersection prevents partial crosses.
float2 intersection = floor(p + 0.5);
float2 intersection4 = abs((frac(intersection / 4.0 + 0.5) - 0.5) * 4.0);
crossMask *= step(0.5, min(intersection4.x, intersection4.y));
// Crosses are intentionally not drawn when they become sub-pixel.
crossMask *= 1.0 - smoothstep(0.025, 0.09, footprint);
// Larger crosses only at intersections of TWO 4m lines.
float majorHorizontal = Stroke(majorDist.y, MAJOR_CROSS_WIDTH * 0.5, pixel.y)
* Stroke(majorDist.x, MAJOR_CROSS_ARM_LENGTH, pixel.x);
float majorVertical = Stroke(majorDist.x, MAJOR_CROSS_WIDTH * 0.5, pixel.x)
* Stroke(majorDist.y, MAJOR_CROSS_ARM_LENGTH, pixel.y);
majorCrossMask = max(majorHorizontal, majorVertical);
majorCrossMask *= 1.0 - smoothstep(0.025, 0.09, footprint);
// Dots must not appear on ANY line work: 1m grid, 4m grid, 1m crosses, or 4m crosses.
float occupiedByLines = saturate(max(max(gridMask, majorMask), max(crossMask, majorCrossMask)));
dotMask *= 1.0 - occupiedByLines;
return saturate(float4(dotMask, gridMask, majorMask, crossMask));
}
float3 ObjectAxisScales()
{
float3x3 m = (float3x3)GetObjectToWorldMatrix();
return float3(length(mul(m, float3(1, 0, 0))),
length(mul(m, float3(0, 1, 0))),
length(mul(m, float3(0, 0, 1))));
}
ENDHLSL
Pass
{
Name "ForwardLit"
Tags { "LightMode"="UniversalForward" }
Cull Back
ZWrite On
HLSLPROGRAM
#pragma target 3.5
#pragma vertex Vert
#pragma fragment Frag
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile _ _SHADOWS_SOFT
#pragma multi_compile_fog
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ _FORWARD_PLUS
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
struct Attributes
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
float2 staticLightmapUV : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float3 positionWS : TEXCOORD0;
half3 normalWS : TEXCOORD1;
float3 positionOS : TEXCOORD5;
half3 normalOS : TEXCOORD6;
half3 vertexLighting : TEXCOORD2;
half fogFactor : TEXCOORD3;
DECLARE_LIGHTMAP_OR_SH(staticLightmapUV, vertexSH, 4);
UNITY_VERTEX_INPUT_INSTANCE_ID
};
Varyings Vert(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
VertexPositionInputs pos = GetVertexPositionInputs(input.positionOS);
VertexNormalInputs nrm = GetVertexNormalInputs(input.normalOS);
output.positionCS = pos.positionCS;
output.positionWS = pos.positionWS;
output.positionOS = input.positionOS;
output.normalOS = input.normalOS;
output.normalWS = nrm.normalWS;
output.vertexLighting = VertexLighting(pos.positionWS, nrm.normalWS);
output.fogFactor = ComputeFogFactor(pos.positionCS.z);
OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV);
OUTPUT_SH(output.normalWS, output.vertexSH);
return output;
}
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
float3 n = normalize(input.normalWS);
// Object-local projection, expressed in physical meters along each local axis.
// Moving/rotating an object moves/rotates the grid. Scaling it preserves spacing.
float3 patternPosition = input.positionOS * ObjectAxisScales();
float3 localN = normalize((float3)input.normalOS);
float3 weights = pow(abs(localN), TRIPLANAR_SHARPNESS);
weights /= max(weights.x + weights.y + weights.z, 0.00001);
float crossX, crossY, crossZ;
float4 pattern = Pattern2D(patternPosition.yz, crossX) * weights.x
+ Pattern2D(patternPosition.xz, crossY) * weights.y
+ Pattern2D(patternPosition.xy, crossZ) * weights.z;
float majorCross = saturate(crossX * weights.x + crossY * weights.y + crossZ * weights.z);
// Tiny dark dots fade away with camera distance.
float cameraDistance = distance(input.positionWS, _WorldSpaceCameraPos);
float dotVisibility = 1.0 - smoothstep(DOT_FADE_START, DOT_FADE_END, cameraDistance);
half3 albedo = _BaseColor.rgb;
float darkening = saturate(pattern.x * DOT_DARKEN * dotVisibility
+ pattern.y * GRID_DARKEN);
albedo = lerp(albedo, _DarkColor.rgb, darkening);
// "Transparency" is expressed as a color blend factor toward Pattern Color.
albedo = lerp(albedo, _LineColor.rgb,
saturate(pattern.z * MAJOR_GRID_OPACITY));
albedo = lerp(albedo, _LineColor.rgb,
saturate(pattern.w * CROSS_OPACITY));
// 4m crosses always use the full Pattern Color.
albedo = lerp(albedo, _LineColor.rgb, saturate(majorCross));
SurfaceData surface = (SurfaceData)0;
surface.albedo = albedo;
surface.alpha = 1;
surface.metallic = _Metallic;
surface.smoothness = _Smoothness;
surface.normalTS = half3(0, 0, 1);
surface.occlusion = 1;
InputData lighting = (InputData)0;
lighting.positionWS = input.positionWS;
lighting.normalWS = n;
lighting.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS);
lighting.shadowCoord = TransformWorldToShadowCoord(input.positionWS);
lighting.fogCoord = input.fogFactor;
lighting.vertexLighting = input.vertexLighting;
lighting.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, n);
lighting.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
lighting.shadowMask = half4(1, 1, 1, 1);
half4 color = UniversalFragmentPBR(lighting, surface);
color.rgb = MixFog(color.rgb, lighting.fogCoord);
return color;
}
ENDHLSL
}
// Solid meshes cast shadows; the pattern only modifies their albedo.
Pass
{
Name "ShadowCaster"
Tags { "LightMode"="ShadowCaster" }
ZWrite On
ZTest LEqual
ColorMask 0
Cull Back
HLSLPROGRAM
#pragma vertex ShadowVert
#pragma fragment ShadowFrag
#pragma multi_compile_instancing
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
float3 _LightDirection;
float3 _LightPosition;
struct ShadowAttributes
{
float3 positionOS : POSITION;
float3 normalOS : NORMAL;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct ShadowVaryings { float4 positionCS : SV_POSITION; };
ShadowVaryings ShadowVert(ShadowAttributes input)
{
UNITY_SETUP_INSTANCE_ID(input);
ShadowVaryings output;
float3 positionWS = TransformObjectToWorld(input.positionOS);
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
#if defined(_CASTING_PUNCTUAL_LIGHT_SHADOW)
float3 lightDirection = normalize(_LightPosition - positionWS);
#else
float3 lightDirection = _LightDirection;
#endif
float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirection));
#if UNITY_REVERSED_Z
positionCS.z = min(positionCS.z, UNITY_NEAR_CLIP_VALUE);
#else
positionCS.z = max(positionCS.z, UNITY_NEAR_CLIP_VALUE);
#endif
output.positionCS = positionCS;
return output;
}
half4 ShadowFrag(ShadowVaryings input) : SV_Target { return 0; }
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags { "LightMode"="DepthOnly" }
ZWrite On
ColorMask 0
Cull Back
HLSLPROGRAM
#pragma vertex DepthVert
#pragma fragment DepthFrag
#pragma multi_compile_instancing
struct DepthAttributes
{
float3 positionOS : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct DepthVaryings { float4 positionCS : SV_POSITION; };
DepthVaryings DepthVert(DepthAttributes input)
{
UNITY_SETUP_INSTANCE_ID(input);
DepthVaryings output;
output.positionCS = TransformObjectToHClip(input.positionOS);
return output;
}
half4 DepthFrag(DepthVaryings input) : SV_Target { return 0; }
ENDHLSL
}
}
FallBack Off
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0b6b65e03c0cbc6458620f24738fd6c6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: