diff --git a/Assets/Content/Addressables/Linux.meta b/Assets/Content/Addressables/Linux.meta new file mode 100644 index 0000000000..ef646b35fc --- /dev/null +++ b/Assets/Content/Addressables/Linux.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c169d7005a1f18119bd7265a86fb4d47 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Addressables/Linux/addressables_content_state.bin b/Assets/Content/Addressables/Linux/addressables_content_state.bin new file mode 100644 index 0000000000..dd58c00628 Binary files /dev/null and b/Assets/Content/Addressables/Linux/addressables_content_state.bin differ diff --git a/Assets/Content/Addressables/Linux/addressables_content_state.bin.meta b/Assets/Content/Addressables/Linux/addressables_content_state.bin.meta new file mode 100644 index 0000000000..2a24b30aee --- /dev/null +++ b/Assets/Content/Addressables/Linux/addressables_content_state.bin.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 89a05f89afcc7e68aa6eed036a03021e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision.meta b/Assets/Content/Resources/Vision.meta new file mode 100644 index 0000000000..d8755833ec --- /dev/null +++ b/Assets/Content/Resources/Vision.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 579cd7dcc5246ffc2a0742671f3fc104 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision/SpacePlane.shader b/Assets/Content/Resources/Vision/SpacePlane.shader new file mode 100644 index 0000000000..733d3dd19a --- /dev/null +++ b/Assets/Content/Resources/Vision/SpacePlane.shader @@ -0,0 +1,52 @@ +Shader "Custom/SpacePlane" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "black" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + SubShader + { + ZWrite On + Tags {"Queue"="Transparent" "RenderType"="Transparent" } + LOD 200 + CGPROGRAM + #include "VisionCG.cginc" + #pragma surface surf Standard fullforwardshadows alpha + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + sampler2D _MainTex; + + struct Input + { + float2 uv_MainTex; + float3 worldPos; + }; + + half _Glossiness; + half _Metallic; + fixed4 _Color; + + void surf (Input IN, inout SurfaceOutputStandard o) + { + if(IsVisible(IN.worldPos)) + { + discard; + } + + float4 c = tex2D(_MainTex, IN.uv_MainTex); + o.Albedo = c.rgba; + // Metallic and smoothness come from slider variables + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + + } + ENDCG + } + Fallback "Diffuse" +} diff --git a/Assets/Content/Resources/Vision/SpacePlane.shader.meta b/Assets/Content/Resources/Vision/SpacePlane.shader.meta new file mode 100644 index 0000000000..7d772120b3 --- /dev/null +++ b/Assets/Content/Resources/Vision/SpacePlane.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d7a3002ca6faa3b588f87113808c11bd +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision/Spaceplane.mat b/Assets/Content/Resources/Vision/Spaceplane.mat new file mode 100644 index 0000000000..45bc08b686 --- /dev/null +++ b/Assets/Content/Resources/Vision/Spaceplane.mat @@ -0,0 +1,80 @@ +%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: Spaceplane + m_Shader: {fileID: 4800000, guid: d7a3002ca6faa3b588f87113808c11bd, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _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} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/Content/Resources/Vision/Spaceplane.mat.meta b/Assets/Content/Resources/Vision/Spaceplane.mat.meta new file mode 100644 index 0000000000..b376ffa733 --- /dev/null +++ b/Assets/Content/Resources/Vision/Spaceplane.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6eca9036976e09e19a4246b4f85d04ce +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision/VisionCG.cginc b/Assets/Content/Resources/Vision/VisionCG.cginc new file mode 100644 index 0000000000..7d6e1ba541 --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionCG.cginc @@ -0,0 +1,129 @@ +#ifndef VISION_CG_INCLUDED +#define VISION_CG_INCLUDED + + +UNITY_DECLARE_TEX2D(_CameraDepthTexture); +UNITY_DECLARE_TEX2D(_VisionMap); +float4x4 _PlayerCameraInvViewProj; +float4 _PlayerPos; +float _PlayerAngle; +float _ViewConeWidth; +float _ViewRange; +//TODO setup for multiplatform + +inline bool IsVisible(float2 screenUV); +inline bool IsVisible(float3 posWorld); + +inline float2 WorldToFov(float3 posWorld); +inline float4 FragToClip(float4 frag); +inline float3 ClipToWorld(float2 posClip); +inline bool depthIsSky(float depth); +inline float modulo(float x, float y); + + +//Returns true if the point should be visible to the player +//Prefer posWorld version where possible + +//Use with fragment position in any normal fragment shader +inline bool IsVisible(float4 posFrag) +{ + float4 posClip = FragToClip(posFrag); + return IsVisible(posClip.xy); +} +//Use with UVs in postprocessing shaders +inline bool IsVisible(float2 screenUV) +{ + float3 posWorld = ClipToWorld(screenUV); + return IsVisible(posWorld); +} +//Checks world coordinates against polar depth texture +//Use with world positions in shaders that supply them +inline bool IsVisible(float3 posWorld) +{ + float2 polarCoords = WorldToFov(posWorld); + + float centerAngle = _ViewConeWidth / 2; + float centerAngleWorld = _PlayerAngle; + float rawOffset = polarCoords.y - centerAngleWorld; + float clampedOffset = modulo(rawOffset, UNITY_TWO_PI) - UNITY_PI; + + //return early if angle is outside the view cone + if ((abs(clampedOffset) > centerAngle) && (polarCoords.x > 1)) return false; + + float currentAngle = centerAngle + clampedOffset; + float2 viewUV = float2(currentAngle / _ViewConeWidth, 0); + + float currentDepth = polarCoords.x; + float wallDepth = UNITY_SAMPLE_TEX2D(_VisionMap, viewUV).r * _ViewRange; + + return currentDepth < wallDepth; +} + +// Inputs fragment position (pixelX, pixelY, depth, perspective) +// Outputs clip position([-1,1],[-1,1], depth, perspective) +inline float4 FragToClip(float4 frag) +{ + frag.xy /= _ScreenParams.xy; + frag.xy = frag.xy * 2 - 1; + return frag; +} + +//Converts clip position ([-1,1][-1,1]) to world position +inline float3 ClipToWorld(float2 posClip) +{ + float2 screenUV = posClip * 0.5 + 0.5; + float rawDepth = UNITY_SAMPLE_TEX2D(_CameraDepthTexture, screenUV).r; + + #if !defined(UNITY_REVERSED_Z) + rawDepth = lerp(UNITY_NEAR_CLIP_VALUE, 1, rawDepth); + #endif + + float4 adjClip = float4(posClip, rawDepth, 1); + + float4 worldspace = mul(_PlayerCameraInvViewProj, adjClip); + + if(depthIsSky(rawDepth)) + { + //Ensures skybox is always visible + //Skybox should have dedicated handling in the future + return _PlayerPos; + } + return worldspace.xyz / worldspace.w; + +} + +//Converts world position to polar coordinates (distance, radians) relative to player +inline float2 WorldToFov(float3 posWorld) +{ + float2 posFov = (posWorld - _PlayerPos).xz; + float rawAngle; + + if (posFov.x == 0) rawAngle = 0; + else rawAngle = atan2(posFov.x, -posFov.y); + + float adjAngle = -rawAngle; + float clampedAngle = modulo(adjAngle, UNITY_TWO_PI); + + float worldDepth = length(posFov); + float2 polarCoords = float2(worldDepth, clampedAngle); + + return polarCoords; +} + +//Detect if skybox, requires special handling +inline bool depthIsSky(float depth) +{ + #if defined(UNITY_REVERSED_Z) + return (depth <= 0.0); + #else + return (depth >= 1.0); + #endif +} + +inline float modulo(float x, float y) +{ + return x - y * floor(x/y); +} + + +#endif diff --git a/Assets/Content/Resources/Vision/VisionCG.cginc.meta b/Assets/Content/Resources/Vision/VisionCG.cginc.meta new file mode 100644 index 0000000000..056fe0ef3f --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionCG.cginc.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c2d108105f6ec69e8ddc2b1ba7082e4 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision/VisionMask.shader b/Assets/Content/Resources/Vision/VisionMask.shader new file mode 100644 index 0000000000..e1b9e4d53c --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionMask.shader @@ -0,0 +1,48 @@ +Shader "Vision/VisionMask" +{ + //TODO Clean this up for multiplatform and add comments + SubShader + { + Cull Off ZWrite Off ZTest Always + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + #include "VisionCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + UNITY_DECLARE_TEX2D(_MainTex); + v2f vert(appdata v) + { + v2f o; + o.vertex = float4(v.vertex.xy, 0, 1); + o.uv = v.vertex.xy; + + if (_ProjectionParams.x < 0) o.uv.y = (1 - o.uv.y) - 1; + + return o; + } + float4 frag(v2f i) : SV_Target + { + if(IsVisible(i.uv)) return float4(1,1,1,1); + else return float4(0,0,0,0); + } + + ENDCG + } + } +} diff --git a/Assets/Content/Resources/Vision/VisionMask.shader.meta b/Assets/Content/Resources/Vision/VisionMask.shader.meta new file mode 100644 index 0000000000..97fe0a1e75 --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionMask.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 15369a85bf338fdb7af4340cb5d185ec +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Resources/Vision/VisionMaskBlur.shader b/Assets/Content/Resources/Vision/VisionMaskBlur.shader new file mode 100644 index 0000000000..fac654a512 --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionMaskBlur.shader @@ -0,0 +1,89 @@ +Shader "Vision/VisionMaskBlur" +{ + //TODO Clean this up for multiplatform and add comments + SubShader + { + Cull Off ZWrite Off ZTest Always + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + #include "VisionCG.cginc" + + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + UNITY_DECLARE_TEX2D(_MainTex); + v2f vert(appdata v) + { + v2f o; + o.vertex = float4(v.vertex.xy, 0, 1); + o.uv = (v.vertex.xy + 1) * 0.5; + #if UNITY_UV_STARTS_AT_TOP + o.uv = o.uv * float2(1.0, -1.0) + float2(0.0, 1.0); + #endif + return o; + } + + float _FovBlurQuality; //Angular samples + float _FovBlurDirections; //Linear samples + float2 _FovBlurSize; + UNITY_DECLARE_TEX2D(_FovTex); + float4 frag(v2f IN) : SV_Target + { + float2 diameter = (_FovBlurSize / _ScreenParams.xy) * 2; + float average; + float3 thisPos = ClipToWorld(IN.uv * 2 - 1); + float3 thisDepth = thisPos - _WorldSpaceCameraPos; + float thisVisible = length(UNITY_SAMPLE_TEX2D(_FovTex, IN.uv)) > 0.5; + float totalSamples = 0; + for(float angle = 0; angle < UNITY_TWO_PI; angle += UNITY_TWO_PI / _FovBlurDirections) + { + for(float sample = 1; sample <= _FovBlurQuality; sample++) + { + float2 offset = float2(cos(angle),sin(angle)) * diameter * (sample / _FovBlurQuality); + float2 sampleUV = IN.uv + offset; + float3 samplePos = ClipToWorld(sampleUV * 2 - 1); + float3 sampleDepth = samplePos - _WorldSpaceCameraPos; + if((!thisVisible || length(offset) < 0.006 || (length(thisDepth - sampleDepth) < 0.5))) + { + totalSamples += 1; + if(length(UNITY_SAMPLE_TEX2D(_FovTex, sampleUV)) < 0.5) + { + average += 1; + } + } + } + } + average /= totalSamples; + float4 col = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv); + + if(!thisVisible) //Check if location is masked + { + col = lerp (col, float4(0, 0, 0, 1), 0.2); + } + + if(average > 0) + { + col = float4(0,0,0,1) * average + col * (1 - average); + } + return col; + } + + ENDCG + } + } +} diff --git a/Assets/Content/Resources/Vision/VisionMaskBlur.shader.meta b/Assets/Content/Resources/Vision/VisionMaskBlur.shader.meta new file mode 100644 index 0000000000..3fafbe34ff --- /dev/null +++ b/Assets/Content/Resources/Vision/VisionMaskBlur.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a2c58fdd58bc3e1a9a6970b779eebb57 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Content/Scenes/Game.unity b/Assets/Content/Scenes/Game.unity index eb5d9d9459..959c79c883 100644 --- a/Assets/Content/Scenes/Game.unity +++ b/Assets/Content/Scenes/Game.unity @@ -234,6 +234,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852762468231620 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 3 k__BackingField: {fileID: 0} @@ -249,12 +255,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852762468231620 - k__BackingField: 0 --- !u!1 &274660130 GameObject: m_ObjectHideFlags: 0 @@ -434,6 +434,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852762014670918 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 6 k__BackingField: {fileID: 0} @@ -449,12 +455,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852762014670918 - k__BackingField: 0 --- !u!1 &478499394 GameObject: m_ObjectHideFlags: 0 @@ -563,6 +563,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852762399064293 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 10 k__BackingField: {fileID: 0} @@ -578,12 +584,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 0 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852762399064293 - k__BackingField: 0 --- !u!1 &516802433 GameObject: m_ObjectHideFlags: 0 @@ -629,6 +629,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852762495497741 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 1 k__BackingField: {fileID: 0} @@ -644,12 +650,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852762495497741 - k__BackingField: 0 --- !u!4 &516802436 Transform: m_ObjectHideFlags: 0 @@ -830,6 +830,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852761210609344 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 2 k__BackingField: {fileID: 0} @@ -845,12 +851,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852761210609344 - k__BackingField: 0 --- !u!1 &661652615 GameObject: m_ObjectHideFlags: 0 @@ -915,6 +915,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852759222350558 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 7 k__BackingField: {fileID: 0} @@ -930,12 +936,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852759222350558 - k__BackingField: 0 --- !u!224 &669009801 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 7839063151111624133, guid: ef47552bb578a784f8ef9916b369b6fb, type: 3} @@ -1284,6 +1284,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852761931311011 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 1 k__BackingField: {fileID: 0} @@ -1299,12 +1305,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852761931311011 - k__BackingField: 0 --- !u!114 &914529552 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 4302234173120300195, guid: 313c7a6f7eaaf4f4cb80cbe0fe77005d, type: 3} @@ -1418,6 +1418,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852758797354380 + k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 k__BackingField: {fileID: 0} @@ -1433,12 +1439,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852758797354380 - k__BackingField: 0 --- !u!1 &1000564555 GameObject: m_ObjectHideFlags: 0 @@ -1502,6 +1502,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852761472596133 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 8 k__BackingField: {fileID: 0} @@ -1518,12 +1524,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852761472596133 - k__BackingField: 0 --- !u!1001 &1002102147 PrefabInstance: m_ObjectHideFlags: 0 @@ -1633,7 +1633,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4468402021075485018, guid: cc5383d385556f443b2a7d3202f2b2c1, type: 3} propertyPath: m_AnchoredPosition.y - value: -230.00005 + value: -230 objectReference: {fileID: 0} - target: {fileID: 4468402021449001342, guid: cc5383d385556f443b2a7d3202f2b2c1, type: 3} propertyPath: m_AnchoredPosition.x @@ -2084,6 +2084,89 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1264356887 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1264356888} + - component: {fileID: 1264356890} + - component: {fileID: 1264356889} + m_Layer: 0 + m_Name: SpacePlane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1264356888 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264356887} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -1.01, z: 0} + m_LocalScale: {x: 10, y: 1, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1756968541} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1264356889 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264356887} + m_Enabled: 1 + m_CastShadows: 0 + 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_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6eca9036976e09e19a4246b4f85d04ce, 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_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1264356890 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1264356887} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1448301644 GameObject: m_ObjectHideFlags: 0 @@ -2203,6 +2286,7 @@ Transform: - {fileID: 274660131} - {fileID: 478499395} - {fileID: 478615867} + - {fileID: 1756968541} m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2218,6 +2302,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852761335889925 + k__BackingField: 0 k__BackingField: 0 k__BackingField: 0 k__BackingField: {fileID: 0} @@ -2249,12 +2339,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852761335889925 - k__BackingField: 0 --- !u!114 &1509603938 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 7356885341650864201, guid: df2268f4f5f6669459174c6d7e2043ce, type: 3} @@ -2343,6 +2427,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852762284701941 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 5 k__BackingField: {fileID: 0} @@ -2358,12 +2448,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852762284701941 - k__BackingField: 0 --- !u!1 &1679380531 GameObject: m_ObjectHideFlags: 0 @@ -2395,6 +2479,61 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1756968540 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1756968541} + - component: {fileID: 1756968542} + m_Layer: 0 + m_Name: VisionSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1756968541 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756968540} + 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: + - {fileID: 1264356888} + m_Father: {fileID: 1506918115} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1756968542 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756968540} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: af299b0e71ae82ed3982954cf49b476c, type: 3} + m_Name: + m_EditorClassIdentifier: + showDebug: 0 + visionMap: {fileID: 0} + target: {fileID: 0} + viewRange: 35 + viewConeWidth: 360 + obstacleMask: + serializedVersion: 2 + m_Bits: 65536 + resolution: 5 + detectionOffset: {x: 0, y: 0, z: 0} --- !u!4 &1820032161 stripped Transform: m_CorrespondingSourceObject: {fileID: 7939122254879796211, guid: 2dff3e99d61d74c4282d2983e482289c, type: 3} @@ -2445,6 +2584,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2499635508 + k__BackingField: 10735852761315043637 + k__BackingField: 0 k__BackingField: 1 k__BackingField: 4 k__BackingField: {fileID: 0} @@ -2460,12 +2605,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 65535 - k__BackingField: 0 - _scenePathHash: 2499635508 - k__BackingField: 10735852761315043637 - k__BackingField: 0 --- !u!114 &1927660779 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4112,6 +4251,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 8350229863795259186, guid: df2268f4f5f6669459174c6d7e2043ce, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 8522562115269630352, guid: df2268f4f5f6669459174c6d7e2043ce, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -6271,6 +6414,14 @@ PrefabInstance: propertyPath: m_Name value: Player Camera objectReference: {fileID: 0} + - target: {fileID: 4559952172929818813, guid: b904697874e9a0445ad5e0c9cad35c19, type: 3} + propertyPath: m_AfterStackBundles.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4559952172929818813, guid: b904697874e9a0445ad5e0c9cad35c19, type: 3} + propertyPath: m_AfterStackBundles.Array.data[0].assemblyQualifiedName + value: VisionFilter, SS3D.Systems, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + objectReference: {fileID: 0} - target: {fileID: 4559952172929818815, guid: b904697874e9a0445ad5e0c9cad35c19, type: 3} propertyPath: m_RootOrder value: 15 diff --git a/Assets/Content/Scenes/PostProcessingProfiles/Lobby.asset b/Assets/Content/Scenes/PostProcessingProfiles/Lobby.asset index e8488548bd..4369af75ca 100644 --- a/Assets/Content/Scenes/PostProcessingProfiles/Lobby.asset +++ b/Assets/Content/Scenes/PostProcessingProfiles/Lobby.asset @@ -1468,6 +1468,31 @@ MonoBehaviour: - 0.5 - 0.5 - 0.5 +--- !u!114 &-544443839450707328 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 9788bbdb5ef1f158d9c84116721f0a30, type: 3} + m_Name: VisionMaskEffect + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + Quality: + overrideState: 1 + value: 5 + Directions: + overrideState: 1 + value: 25 + Size: + overrideState: 1 + value: {x: 5, y: 5} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1489,6 +1514,7 @@ MonoBehaviour: - {fileID: -4984722078144235035} - {fileID: -2400775673892574313} - {fileID: -9132564074991082903} + - {fileID: -544443839450707328} --- !u!114 &4662285201658728894 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/Assets/Content/WorldObjects/Entities/Silicon/EngineeringBorg/EngineeringBorg.prefab b/Assets/Content/WorldObjects/Entities/Silicon/EngineeringBorg/EngineeringBorg.prefab index 3800fdd8b8..5afb7a2315 100644 --- a/Assets/Content/WorldObjects/Entities/Silicon/EngineeringBorg/EngineeringBorg.prefab +++ b/Assets/Content/WorldObjects/Entities/Silicon/EngineeringBorg/EngineeringBorg.prefab @@ -1341,6 +1341,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 87 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 7822834359831465168 k__BackingField: 0 k__BackingField: 0 k__BackingField: {fileID: 0} @@ -1359,12 +1365,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 91 - k__BackingField: 0 - _scenePathHash: 0 - k__BackingField: 0 - k__BackingField: 7822834359831465168 --- !u!114 &9083373980788225397 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Content/WorldObjects/Structures/Walls/SteelWall.prefab b/Assets/Content/WorldObjects/Structures/Walls/SteelWall.prefab index cde92f0411..a690061477 100644 --- a/Assets/Content/WorldObjects/Structures/Walls/SteelWall.prefab +++ b/Assets/Content/WorldObjects/Structures/Walls/SteelWall.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 5022873095643711340} - component: {fileID: 7691160284830400485} - m_Layer: 8 + m_Layer: 16 m_Name: RightViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -55,7 +55,7 @@ GameObject: m_Component: - component: {fileID: 6491318275190557950} - component: {fileID: 3247630703720011440} - m_Layer: 8 + m_Layer: 16 m_Name: BackViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -100,7 +100,7 @@ GameObject: m_Component: - component: {fileID: 4770819067178016503} - component: {fileID: 3843643310579965483} - m_Layer: 8 + m_Layer: 16 m_Name: LeftViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -255,6 +255,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 139 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 11535764229462028423 k__BackingField: 0 k__BackingField: 0 k__BackingField: {fileID: 0} @@ -271,12 +277,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 120 - k__BackingField: 0 - _scenePathHash: 0 - k__BackingField: 0 - k__BackingField: 11535764229462028423 --- !u!114 &3395800597640737248 MonoBehaviour: m_ObjectHideFlags: 0 @@ -309,8 +309,12 @@ MonoBehaviour: xOpposite: {fileID: 2858846960137979044, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} xTriple: {fileID: -9073621571367689160, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} xQuad: {fileID: 4199670461815796357, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} - viewObstacles: [] - opaque: 0 + viewObstacles: + - {fileID: 3334414246056966601} + - {fileID: 1361261120174024331} + - {fileID: 7790124558541205835} + - {fileID: 1437294527526757322} + opaque: 1 --- !u!114 &9201248993357086619 MonoBehaviour: m_ObjectHideFlags: 0 @@ -377,7 +381,7 @@ GameObject: m_Component: - component: {fileID: 1313969126098040064} - component: {fileID: 5971711339440298923} - m_Layer: 8 + m_Layer: 16 m_Name: ForwardViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Content/WorldObjects/Structures/Walls/SteelWallReinforced.prefab b/Assets/Content/WorldObjects/Structures/Walls/SteelWallReinforced.prefab index b65bcc548c..cbe1aacded 100644 --- a/Assets/Content/WorldObjects/Structures/Walls/SteelWallReinforced.prefab +++ b/Assets/Content/WorldObjects/Structures/Walls/SteelWallReinforced.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 5022873095643711340} - component: {fileID: 7691160284830400485} - m_Layer: 8 + m_Layer: 16 m_Name: RightViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -55,7 +55,7 @@ GameObject: m_Component: - component: {fileID: 6491318275190557950} - component: {fileID: 3247630703720011440} - m_Layer: 8 + m_Layer: 16 m_Name: BackViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -100,7 +100,7 @@ GameObject: m_Component: - component: {fileID: 4770819067178016503} - component: {fileID: 3843643310579965483} - m_Layer: 8 + m_Layer: 16 m_Name: LeftViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} @@ -253,11 +253,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} m_Name: m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 174 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 15843822419293565003 k__BackingField: 0 k__BackingField: 0 k__BackingField: {fileID: 0} _networkBehaviours: - {fileID: 3011383631706744183} + - {fileID: -6351445020948675988} k__BackingField: {fileID: 0} k__BackingField: [] SerializedTransformProperties: @@ -268,12 +275,6 @@ MonoBehaviour: _isGlobal: 0 _initializeOrder: 0 _defaultDespawnType: 0 - NetworkObserver: {fileID: 0} - k__BackingField: 174 - k__BackingField: 0 - _scenePathHash: 0 - k__BackingField: 0 - k__BackingField: 15843822419293565003 --- !u!114 &3011383631706744183 MonoBehaviour: m_ObjectHideFlags: 0 @@ -306,8 +307,12 @@ MonoBehaviour: xOpposite: {fileID: -7744038958267161825, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} xTriple: {fileID: 5869884649093938551, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} xQuad: {fileID: 4199670461815796357, guid: 9c0b392ffb24ca248a002fe36b08bae8, type: 3} - viewObstacles: [] - opaque: 0 + viewObstacles: + - {fileID: 3334414246056966601} + - {fileID: 1361261120174024331} + - {fileID: 7790124558541205835} + - {fileID: 1437294527526757322} + opaque: 1 --- !u!114 &6332977986281627431 MonoBehaviour: m_ObjectHideFlags: 0 @@ -334,9 +339,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ff65a9dda1ef18f4cbc16ee4d1aee066, type: 3} m_Name: m_EditorClassIdentifier: - _componentIndexCache: 255 + _componentIndexCache: 1 _addedNetworkObject: {fileID: -2900075557854325373} - _networkObjectCache: {fileID: 0} + _networkObjectCache: {fileID: -2900075557854325373} _asset: {fileID: 11400000, guid: 9b16536c8b6953b459e5906389bc4cdd, type: 2} _tileObjectSo: {fileID: 11400000, guid: 8723b9e3524165d4abbbb6e295e85330, type: 2} --- !u!1 &7790124558541205835 @@ -349,7 +354,7 @@ GameObject: m_Component: - component: {fileID: 1313969126098040064} - component: {fileID: 5971711339440298923} - m_Layer: 8 + m_Layer: 16 m_Name: ForwardViewObstacle m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/DefaultPrefabObjects.asset b/Assets/DefaultPrefabObjects.asset index 9e62d4fee5..d3abca490f 100644 --- a/Assets/DefaultPrefabObjects.asset +++ b/Assets/DefaultPrefabObjects.asset @@ -29,20 +29,15 @@ MonoBehaviour: - {fileID: 6453146791042422614, guid: bdeac5e9a27546348a584caa74f00ec7, type: 3} - {fileID: 2090837846029440516, guid: ddaa28fac1956b2428aff1dac1d89707, type: 3} - {fileID: 6115335805774105745, guid: bf177f8bab26bc84b87fd9a971004418, type: 3} - - {fileID: 6699414010407460003, guid: f1aeab0a35c29314a8a3f823de9815c1, type: 3} - - {fileID: 4692070367735979832, guid: 8725b7f8f45d28a4ba6063318904cc8a, type: 3} - - {fileID: 6270372984438359393, guid: f549f4153ef612c4586c46ea280e0e94, type: 3} - - {fileID: 3346295071430447723, guid: 1a2f912be4bc1b948a2b22ffde517cdc, type: 3} - - {fileID: 2957918649098045964, guid: 88d1ba1edb4ce5e4fa74c6a8d53e36e1, type: 3} - - {fileID: 5462163768199098969, guid: bc08055e4ec2e204f8f46a379b2b6603, type: 3} + - {fileID: 4692070367735979832, guid: 65679cf5a30d6dd458666804af7c3ca3, type: 3} + - {fileID: 3346295071430447723, guid: db15899bc1eb2794fb2b24129852a209, type: 3} + - {fileID: 1193101747660343740, guid: a38ee818c953a404787757d8d20d2851, type: 3} - {fileID: 6405064644360513769, guid: be3fcf1a74268ad49bfedb1edd9f5318, type: 3} - {fileID: 1248430174884186406, guid: 7436f4976849b994aaee40df1bca7d89, type: 3} - {fileID: 2527334834019670621, guid: 236b51ddc6f9aa94ca92579082370c06, type: 3} - {fileID: 8962699864590013468, guid: 93ad90421a3b2f64e8fdb9e95a42ba90, type: 3} - - {fileID: 8681604604373809337, guid: 5fa15d6fdef93dc4e80d798cefe8be0b, type: 3} - - {fileID: 8663352389375050187, guid: 317ec7dcff3b11d4eae3a47929200b93, type: 3} - - {fileID: 8657890218937463745, guid: 4b790b4ffedbe564dab49f896d71eaa6, type: 3} - - {fileID: 7421556062366613563, guid: d7d68992cbd3cda45bb11a35a1490dc3, type: 3} + - {fileID: 8663352389375050187, guid: 81faf4debf00a0a478b924176f48d011, type: 3} + - {fileID: 7421556062366613563, guid: 535ed7c02b5cbdc43ae2b234a963c5cc, type: 3} - {fileID: 3546473533537016869, guid: 9b9f6bd470226a74b903e74dbe9e423a, type: 3} - {fileID: 7384563213340008115, guid: 40d904629802fc942860ce878e78efef, type: 3} - {fileID: -1921154974467191097, guid: 1ef3c21a685ec2d4e9f0876719839d5f, type: 3} @@ -52,8 +47,8 @@ MonoBehaviour: - {fileID: -4994790824565799921, guid: a28267798293970468ab30803632a3f7, type: 3} - {fileID: 7823849392942818498, guid: 854451834f026fb4f860bf0e977a104c, type: 3} - {fileID: 7564222845035831833, guid: 3b33b5cf16a677a4e85a110679cde32a, type: 3} - - {fileID: -752502555905215929, guid: 11a2276338ebc64429dfc565b491e437, type: 3} - {fileID: -5633820156739102180, guid: 4c966398d6624164c910cd29c1faa980, type: 3} + - {fileID: -752502555905215929, guid: 11a2276338ebc64429dfc565b491e437, type: 3} - {fileID: -7828078595381397262, guid: 50dd6be959d44844ab1abf8a3f2adb01, type: 3} - {fileID: -7828078595381397262, guid: d07b5fba3896ff448855d6e54356c365, type: 3} - {fileID: -7828078595381397262, guid: a777a6da30f0704478e25312963a8151, type: 3} diff --git a/Assets/FishNet/Runtime/Object/NetworkObject.cs.meta b/Assets/FishNet/Runtime/Object/NetworkObject.cs.meta index 228ed52d63..693a5ce037 100644 --- a/Assets/FishNet/Runtime/Object/NetworkObject.cs.meta +++ b/Assets/FishNet/Runtime/Object/NetworkObject.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: bf9191e2e07d29749bca3a1ae44e4bc8, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/SS3D.Systems.asmdef b/Assets/Scripts/SS3D/Systems/SS3D.Systems.asmdef index 461b3792aa..4a2e08bb8e 100644 --- a/Assets/Scripts/SS3D/Systems/SS3D.Systems.asmdef +++ b/Assets/Scripts/SS3D/Systems/SS3D.Systems.asmdef @@ -26,7 +26,10 @@ "GUID:493bb11add906094faa30425cab7ce2e", "GUID:eec0964c48f6f4e40bc3ec2257ccf8c5", "GUID:776d03a35f1b52c4a9aed9f56d7b4229", - "GUID:84651a3751eca9349aac36a66bba901b" + "GUID:84651a3751eca9349aac36a66bba901b", + "GUID:d60799ab2a985554ea1a39cd38695018", + "GUID:a35efad8797223d499f8c68b1f545dbc", + "GUID:f851af5d86c208af09cd265d08e3b3e2" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/Scripts/SS3D/Systems/Vision.meta b/Assets/Scripts/SS3D/Systems/Vision.meta new file mode 100644 index 0000000000..9094c57c4c --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d0ad4fddcfdc3bc3a7e96be342ec619 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/Vision/Editor.meta b/Assets/Scripts/SS3D/Systems/Vision/Editor.meta new file mode 100644 index 0000000000..abd6a4e408 --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f60855b57f968a8e2a70dc7803dc6d5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef new file mode 100644 index 0000000000..05f6097cf4 --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef @@ -0,0 +1,23 @@ +{ + "name": "VisionSystemEditor", + "rootNamespace": "", + "references": [ + "GUID:ca7dfa56d1d490249a5fe56aee92a13c", + "GUID:92a1e40b8cccf8645adbdd275ac6371a", + "GUID:478a2357cc57436488a56e564b08d223", + "GUID:6e00473804df0f0468c07310fbce5737", + "GUID:9e24947de15b9834991c9d8411ea37cf", + "GUID:eb242eaf9f292954eb8c6fbd63c46deb" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef.meta b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef.meta new file mode 100644 index 0000000000..e4b2f07be3 --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 54f72d63edc373a4294f5967a9b6f5f6 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs new file mode 100644 index 0000000000..5667be1f74 --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs @@ -0,0 +1,69 @@ +using UnityEditor; +using UnityEngine; + +namespace SS3D.Systems.Vision +{ + [CustomEditor(typeof(VisionSubSystem))] + public class VisionSystemEditor : UnityEditor.Editor + { + private VisionSubSystem _vision; + + private SerializedProperty _detectionOffsetProp; + private SerializedProperty _viewConeWidthProp; + private SerializedProperty _viewRangeProp; + + protected void OnEnable() + { + _vision = (VisionSubSystem)target; + + _detectionOffsetProp = serializedObject.FindProperty("detectionOffset"); + _viewConeWidthProp = serializedObject.FindProperty("viewConeWidth"); + _viewRangeProp = serializedObject.FindProperty("viewRange"); + } + + protected void OnSceneGUI() + { + if (!_vision.showDebug) + { + return; + } + + serializedObject.Update(); + + GUIStyle labelStyle = new GUIStyle + { + fontSize = 14, + }; + Unity.Collections.NativeArray viewPoints = _vision.viewPoints; + + Vector3 viewAngleA = _vision.DirectionFromAngle(-_viewConeWidthProp.floatValue / 2, false); + Vector3 viewAngleB = _vision.DirectionFromAngle(_viewConeWidthProp.floatValue / 2, false); + + Vector3 center = _vision.target.position + _detectionOffsetProp.vector3Value; + + Handles.color = Color.green; + Handles.Label(center, "center"); + + labelStyle.normal.textColor = Color.green; + Handles.DrawWireArc(center, Vector3.up, Vector3.forward, 360, _viewRangeProp.floatValue); + + Handles.DrawLine(center, center + (viewAngleA * _viewRangeProp.floatValue)); + Handles.DrawLine(center, center + (viewAngleB * _viewRangeProp.floatValue)); + + // Draw Visual Vision outline; + Handles.color = Color.yellow; + GUIStyle style = new GUIStyle(); + style.normal.textColor = Color.red; + + Handles.Label(viewPoints[0], "0", style); + for (int i = 1; i <= _vision.stepCount; i++) + { + Handles.Label(viewPoints[i % _vision.stepCount], i.ToString(), style); + Handles.color = Color.yellow; + Handles.DrawLine(viewPoints[i % _vision.stepCount], center); + Handles.color = Color.cyan; + Handles.DrawLine(viewPoints[i % _vision.stepCount], viewPoints[(i + 1) % _vision.stepCount]); + } + } + } +} diff --git a/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs.meta b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs.meta new file mode 100644 index 0000000000..c6f0e1393b --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/Editor/VisionSystemEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 605fdba6734adb5d7b4de429fbf5b283 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs b/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs new file mode 100644 index 0000000000..d51628e390 --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; +using UnityEngine.Rendering; + +[Serializable] +[PostProcess(typeof(VisionRenderer), PostProcessEvent.AfterStack, "Vision/VisionMask")] +public sealed class VisionMaskEffect : PostProcessEffectSettings +{ + public FloatParameter Quality = new FloatParameter {value = 5}; + public FloatParameter Directions = new FloatParameter {value = 25}; + public Vector2Parameter Size = new Vector2Parameter {value = new Vector2(5,5)}; + + public override bool IsEnabledAndSupported(PostProcessRenderContext context) + { + return enabled.value + && Quality.value > 0f + && Directions.value > 0f + && Size.value.x >0f + && Size.value.y >0f; + } +} +public sealed class VisionRenderer : PostProcessEffectRenderer +{ + public override void Render(PostProcessRenderContext context) + { + var camera = context.camera; + if((int)camera.depthTextureMode < 1) + { + camera.depthTextureMode += 1; + } + var worldToCameraMatrix = context.camera.worldToCameraMatrix; + var projectionMatrix = GL.GetGPUProjectionMatrix(context.camera.projectionMatrix, false); + var viewProjectionMatrix = projectionMatrix * (worldToCameraMatrix); + var fovTexture = RenderTexture.GetTemporary(Screen.width,Screen.height); + + var sheet = context.propertySheets.Get(Shader.Find("Vision/VisionMask")); + + sheet.properties.SetMatrix("_PlayerCameraInvViewProj", viewProjectionMatrix.inverse); + + context.command.BlitFullscreenTriangle(context.source, fovTexture, sheet, 0,false,null,true); + + + sheet = context.propertySheets.Get(Shader.Find("Vision/VisionMaskBlur")); + + sheet.properties.SetFloat("_FovBlurQuality", settings.Quality); + sheet.properties.SetFloat("_FovBlurDirections", settings.Directions); + sheet.properties.SetVector("_FovBlurSize", settings.Size); + sheet.properties.SetMatrix("_PlayerCameraInvViewProj", viewProjectionMatrix.inverse); + sheet.properties.SetTexture("_FovTex", fovTexture); + + context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0,false,null,true); + + RenderTexture.ReleaseTemporary(fovTexture); + } +} diff --git a/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs.meta b/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs.meta new file mode 100644 index 0000000000..87f086db8f --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/VisionMaskEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9788bbdb5ef1f158d9c84116721f0a30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs b/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs new file mode 100644 index 0000000000..c06947da2e --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs @@ -0,0 +1,250 @@ +using System; +using Unity.Collections; +using Unity.Jobs; +using Unity.Profiling; +using UnityEngine; +using UnityEngine.Rendering; +using SS3D.Systems.Entities.Events; +using Coimbra; +using Coimbra.Services.Events; + +namespace SS3D.Systems.Vision +{ + public class VisionSubSystem : Core.Behaviours.SubSystem + { + [SerializeField] + public bool showDebug; + [SerializeField] + private Texture2D visionMap; + + [SerializeField] + public Transform target = null; + + [Space] + [SerializeField] + private float viewRange = 35; + + [Range(0, 360)] + [SerializeField] + [Tooltip("The field of view width")] + private float viewConeWidth = 360; + + [SerializeField] + [Tooltip("Which layers this can't see through")] + private LayerMask obstacleMask = 0; + + [SerializeField] + [Tooltip("Raycasts per degree")] + private float resolution = 1f; + + [SerializeField] + [Tooltip("The center of the field of view's actual wall detection")] + private Vector3 detectionOffset = Vector3.zero; + + [NonSerialized] + public NativeArray viewPoints; + [NonSerialized] + public int stepCount; + + // Buffer for view cast batching + private ViewCastInfo[] viewCastResults; + // Buffer for view cast angles + private float[] angleBuffer; + + static ProfilerMarker MapPerformanceMarker = new ProfilerMarker("Vision.VisionMap"); + static ProfilerMarker PointsPerformanceMarker = new ProfilerMarker("Vision.ViewPoints"); + + protected override void OnAwake() + { + base.OnAwake(); + + AddHandle(LocalPlayerObjectChanged.AddListener(HandlePlayerObjectChanged)); + } + + protected override void OnEnabled() + { + // Only run when graphics are present + // TODO: Only run on client + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) + { + gameObject.Dispose(gameObject); + } + + visionMap = new Texture2D(Mathf.RoundToInt(viewConeWidth * resolution), 1, TextureFormat.R16, false); + visionMap.wrapMode = TextureWrapMode.Repeat; + visionMap.filterMode = FilterMode.Bilinear; + Shader.SetGlobalTexture("_VisionMap", visionMap); + + stepCount = Mathf.CeilToInt(viewConeWidth * resolution); + viewPoints = new NativeArray(stepCount + 1, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); + + viewCastResults = new ViewCastInfo[stepCount + 1]; + angleBuffer = new float[viewCastResults.Length]; + } + + protected override void OnDisabled() + { + viewPoints.Dispose(); + } + + private void HandlePlayerObjectChanged(ref EventContext context, in LocalPlayerObjectChanged e) + { + target = e.PlayerObject.transform; + } + + private void LateUpdate() + { + if (!target) + { + return; + } + + transform.position = target.transform.position; + float angle = target.transform.rotation.eulerAngles.y * Mathf.Deg2Rad; + + Shader.SetGlobalVector("_PlayerPos", target.transform.position); + Shader.SetGlobalFloat("_PlayerAngle", angle); + Shader.SetGlobalFloat("_ViewConeWidth", viewConeWidth * Mathf.Deg2Rad); + Shader.SetGlobalFloat("_ViewRange", viewRange); + + DrawVisionMap(); + } + + public Vector3 DirectionFromAngle(float angleInDegrees, bool angleIsGlobal) + { + if (!angleIsGlobal) + { + angleInDegrees += target.transform.eulerAngles.y; + } + + Quaternion rotation = Quaternion.AngleAxis(angleInDegrees, Vector3.up); + return rotation * Vector3.forward; + } + + private void DrawVisionMap() + { + PointsPerformanceMarker.Begin(); + CalculateViewPoints(); + PointsPerformanceMarker.End(); + + MapPerformanceMarker.Begin(); + + if (visionMap.width != stepCount) + { + visionMap.Reinitialize(stepCount, 1); + } + + Color[] depths = new Color[stepCount + 1]; + for (int i = 0; i < stepCount; i++) + { + Vector3 positionOS = viewPoints[i % stepCount] - target.transform.position; + positionOS.y = 0; + depths[i] = new Color(positionOS.magnitude / viewRange, 0, 0); + } + +#pragma warning disable UNT0017 // SetPixels invocation is slow + visionMap.SetPixels(depths); +#pragma warning restore UNT0017 // SetPixels invocation is slow + visionMap.Apply(); + + MapPerformanceMarker.End(); + } + + private void CalculateViewPoints() + { + stepCount = Mathf.CeilToInt(viewConeWidth * resolution); + float stepAngleSize = viewConeWidth / stepCount; + float halfCone = viewConeWidth / 2; + + if (viewCastResults.Length < stepCount) + { + Array.Resize(ref viewCastResults, stepCount + 1); + Array.Resize(ref angleBuffer, stepCount + 1); + viewPoints.Dispose(); + viewPoints = new NativeArray(stepCount + 1, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); + } + + for (int i = 0; i < stepCount; i++) + { + angleBuffer[i] = (target.transform.rotation.eulerAngles.y - halfCone) + (stepAngleSize * i); + } + + ViewCastBatch(angleBuffer, viewCastResults); + for (int i = 0; i < stepCount; i++) + { + ViewCastInfo newViewCast = viewCastResults[i]; + + viewPoints[i] = viewCastResults[i].Point; + } + } + + private void ViewCastBatch(float[] angles, ViewCastInfo[] resultArray) + { + if (resultArray.Length < angles.Length) + { + throw new ArgumentException("Results can't be smaller than angles", nameof(resultArray)); + } + + // Allocate arrays for raycast data + NativeArray hits = new NativeArray(angles.Length, Allocator.TempJob); + NativeArray commands = new NativeArray(angles.Length, Allocator.TempJob, NativeArrayOptions.UninitializedMemory); + + Vector3 origin = target.transform.position; + + // Create raycast commands + for (int i = 0; i < angles.Length; i++) + { + commands[i] = new RaycastCommand(origin, DirectionFromAngle(angles[i], true), viewRange, obstacleMask); + } + + // Schedule raycasts + JobHandle handle = RaycastCommand.ScheduleBatch(commands, hits, 1); + + // Wait for the raycasting to complete + handle.Complete(); + + // Fill results array + for (int i = 0; i < hits.Length; i++) + { + RaycastHit hit = hits[i]; + + // Collider is only valid if hit (yes, this is in the docs) + if (hit.collider) + { + resultArray[i] = new ViewCastInfo(true, hit.point, hit.distance, angles[i], hit.normal); + } + else + { + resultArray[i] = new ViewCastInfo( + false, + origin + (DirectionFromAngle(angles[i], true) * viewRange), + viewRange, + angles[i], + hit.normal); + } + } + + // Dispose raycast data + hits.Dispose(); + commands.Dispose(); + } + + public struct ViewCastInfo + { + public bool Hit; + public Vector3 Point; + public float Distance; + public float Angle; + public Vector3 Normal; + + public ViewCastInfo(bool hit, Vector3 point, float distance, float angle, Vector3 normal) + { + Hit = hit; + Point = point; + Distance = distance; + Angle = angle; + Normal = normal; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs.meta b/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs.meta new file mode 100644 index 0000000000..5c051e173c --- /dev/null +++ b/Assets/Scripts/SS3D/Systems/Vision/VisionSubSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af299b0e71ae82ed3982954cf49b476c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Settings/NetworkSettings.asset b/Assets/Settings/NetworkSettings.asset index 23aecc3cac..ed4320f9b4 100644 --- a/Assets/Settings/NetworkSettings.asset +++ b/Assets/Settings/NetworkSettings.asset @@ -17,5 +17,5 @@ MonoBehaviour: NetworkType: 2 _ckey: hostingUser ServerAddress: 127.0.0.1 - ServerPort: 8616 + ServerPort: 7412 EnableNetworkBandwidthUsageStats: 1 diff --git a/Builds/Game/Config/permissions.txt b/Builds/Game/Config/permissions.txt index b747f028aa..bc9ca22702 100644 --- a/Builds/Game/Config/permissions.txt +++ b/Builds/Game/Config/permissions.txt @@ -1,3 +1,4 @@ john ServerOwner editorUser ServerOwner -hostingUser Administrator +hostingUser ServerOwner +unknown ServerOwner diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 6d68af32ea..4c367b5587 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -21,8 +21,8 @@ TagManager: - - - - - - - + - VisionObstacles + - VisionMask - - -