diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..2820d35 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,36 @@ +{ + "files.exclude": + { + "**/.DS_Store": true, + "**/.git": false, + "**/.git/": true, + "**/.gitattributes": true, + "**/.gitmodules": true, + "**/*.meta": true, + "build/": true, + "Build/": true, + "library/": true, + "Library/": true, + "obj/": true, + "Obj/": true, + "ProjectSettings/": true, + "temp/": true, + "Temp/": true + }, + "files.watcherExclude": { + "**/.git/**": true, + "**/.git/objects/**": false, + "**/.git/subtree-cache/**": false, + "**/*.meta": true, + "**/build/**": true, + "**/Build/**": true, + "**/library/**": true, + "**/Library/**": true, + "**/obj/**": true, + "**/Obj/**": true, + "**/ProjectSettings/**": true, + "**/SteamVR*/**": true, + "**/temp/**": true, + "**/Temp/**": true + } +} \ No newline at end of file diff --git a/Assets/Materials.meta b/Assets/Materials.meta new file mode 100644 index 0000000..d9cfd6a --- /dev/null +++ b/Assets/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b204bdb66033945b2998a9fb3e57af8c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/PrototypeBlue.mat b/Assets/Materials/PrototypeBlue.mat new file mode 100644 index 0000000..b3b6a4a --- /dev/null +++ b/Assets/Materials/PrototypeBlue.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PrototypeBlue + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + 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_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.558 + - _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: 0, g: 0.5716195, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Materials/PrototypeBlue.mat.meta b/Assets/Materials/PrototypeBlue.mat.meta new file mode 100644 index 0000000..bd9407e --- /dev/null +++ b/Assets/Materials/PrototypeBlue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab9f88402c0769547a2c7a090f1af6d9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/PrototypeGrey.mat b/Assets/Materials/PrototypeGrey.mat new file mode 100644 index 0000000..4433a16 --- /dev/null +++ b/Assets/Materials/PrototypeGrey.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PrototypeGrey + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + 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_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.192 + - _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: 0.5660378, g: 0.5660378, b: 0.5660378, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Materials/PrototypeGrey.mat.meta b/Assets/Materials/PrototypeGrey.mat.meta new file mode 100644 index 0000000..331c41f --- /dev/null +++ b/Assets/Materials/PrototypeGrey.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b18aa676c8e7832a09b7acae21ed5662 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/PrototypeRed.mat b/Assets/Materials/PrototypeRed.mat new file mode 100644 index 0000000..362851d --- /dev/null +++ b/Assets/Materials/PrototypeRed.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: PrototypeRed + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + 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_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.609 + - _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: 0.103773594, b: 0.103773594, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Materials/PrototypeRed.mat.meta b/Assets/Materials/PrototypeRed.mat.meta new file mode 100644 index 0000000..0f50b6a --- /dev/null +++ b/Assets/Materials/PrototypeRed.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4eb51db75e53bb881bf754f79988c934 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs.meta b/Assets/Prefabs.meta new file mode 100644 index 0000000..ef75d7f --- /dev/null +++ b/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0dcdbe3b3317acc981af26ab72c85d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Cell.prefab b/Assets/Prefabs/Cell.prefab new file mode 100644 index 0000000..7a33d0b --- /dev/null +++ b/Assets/Prefabs/Cell.prefab @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4312626832982465632 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7593718857162761721} + m_Layer: 0 + m_Name: Cell + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7593718857162761721 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4312626832982465632} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.3045772, y: -0.71958035, z: -0.3215394} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 850907284803132359} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5353459015872337001 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 850907284803132359} + - component: {fileID: 6905165132563712277} + - component: {fileID: 3052921385566872828} + - component: {fileID: 5069835026282644199} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &850907284803132359 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5353459015872337001} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9, y: 0.19158857, z: 0.9} + m_Children: [] + m_Father: {fileID: 7593718857162761721} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6905165132563712277 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5353459015872337001} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3052921385566872828 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5353459015872337001} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b18aa676c8e7832a09b7acae21ed5662, 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 +--- !u!65 &5069835026282644199 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5353459015872337001} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/Cell.prefab.meta b/Assets/Prefabs/Cell.prefab.meta new file mode 100644 index 0000000..1bc91c5 --- /dev/null +++ b/Assets/Prefabs/Cell.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 17e170c19d044ffe0a220abb08ae9d7d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/EnemyIndicator.prefab b/Assets/Prefabs/EnemyIndicator.prefab new file mode 100644 index 0000000..b0204a5 --- /dev/null +++ b/Assets/Prefabs/EnemyIndicator.prefab @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3732195104394283809 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8236840291962373263} + - component: {fileID: 2761892026788009565} + - component: {fileID: 6043270924706872244} + - component: {fileID: 4601422251162099119} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8236840291962373263 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3732195104394283809} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.125, z: 0} + m_LocalScale: {x: 0.9, y: 0.2, z: 0.9} + m_Children: [] + m_Father: {fileID: 1216651539984054961} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2761892026788009565 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3732195104394283809} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6043270924706872244 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3732195104394283809} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4eb51db75e53bb881bf754f79988c934, 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 +--- !u!65 &4601422251162099119 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3732195104394283809} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &4781031086883701544 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1216651539984054961} + m_Layer: 0 + m_Name: EnemyIndicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1216651539984054961 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4781031086883701544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.8537874, y: 0, z: -4.4023027} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8236840291962373263} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/EnemyIndicator.prefab.meta b/Assets/Prefabs/EnemyIndicator.prefab.meta new file mode 100644 index 0000000..dd30bc6 --- /dev/null +++ b/Assets/Prefabs/EnemyIndicator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 993895520ab0bb667b46c52eada7ba72 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Grid World.prefab b/Assets/Prefabs/Grid World.prefab new file mode 100644 index 0000000..cf01a1e --- /dev/null +++ b/Assets/Prefabs/Grid World.prefab @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6466675777360773743 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6159513309455308054} + - component: {fileID: 5166608720900095202} + m_Layer: 0 + m_Name: Grid World + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6159513309455308054 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6466675777360773743} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5166608720900095202 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6466675777360773743} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0c1492f8fc8e71355ae6643b3dba3cdf, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSize: 1 + neutralZone: 4 + width: 4 + length: 4 diff --git a/Assets/Prefabs/Grid World.prefab.meta b/Assets/Prefabs/Grid World.prefab.meta new file mode 100644 index 0000000..b137e04 --- /dev/null +++ b/Assets/Prefabs/Grid World.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc76d76453b9adefe9c6bb2dd95e66b3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Physical Grid.prefab b/Assets/Prefabs/Physical Grid.prefab new file mode 100644 index 0000000..369badd --- /dev/null +++ b/Assets/Prefabs/Physical Grid.prefab @@ -0,0 +1,144 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4448783347283947931 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4448783347283947932} + - component: {fileID: 4448783347283947935} + - component: {fileID: 4448783347283947934} + - component: {fileID: 4448783347283947933} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4448783347283947932 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347283947931} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.25, z: 0} + m_LocalScale: {x: 7, y: 0.5, z: 16} + m_Children: [] + m_Father: {fileID: 4448783347927182949} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4448783347283947935 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347283947931} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4448783347283947934 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347283947931} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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 +--- !u!65 &4448783347283947933 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347283947931} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &4448783347927182947 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4448783347927182949} + - component: {fileID: 4448783347927182948} + m_Layer: 0 + m_Name: Physical Grid + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4448783347927182949 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347927182947} + 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_Children: + - {fileID: 4448783347283947932} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4448783347927182948 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4448783347927182947} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e564f9337cfd99775b8afcf9a56f82ea, type: 3} + m_Name: + m_EditorClassIdentifier: + cellPrefab: {fileID: 4312626832982465632, guid: 17e170c19d044ffe0a220abb08ae9d7d, + type: 3} + playerIndicator: {fileID: 1653133395508173151, guid: dab0478d3b2020af4b585450d724e245, + type: 3} + enemyIndicator: {fileID: 4781031086883701544, guid: 993895520ab0bb667b46c52eada7ba72, + type: 3} diff --git a/Assets/Prefabs/Physical Grid.prefab.meta b/Assets/Prefabs/Physical Grid.prefab.meta new file mode 100644 index 0000000..2221eaa --- /dev/null +++ b/Assets/Prefabs/Physical Grid.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/PlayerIndicator.prefab b/Assets/Prefabs/PlayerIndicator.prefab new file mode 100644 index 0000000..74304ba --- /dev/null +++ b/Assets/Prefabs/PlayerIndicator.prefab @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1653133395508173151 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1101810178173332474} + m_Layer: 0 + m_Name: PlayerIndicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1101810178173332474 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1653133395508173151} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.8537874, y: 0, z: -5.167} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8951352142750061214} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7629652522327332745 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8951352142750061214} + - component: {fileID: 2220002712130868091} + - component: {fileID: 5820070644628450190} + - component: {fileID: 3039296476964889407} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8951352142750061214 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7629652522327332745} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.354, z: 0} + m_LocalScale: {x: 0.135009, y: 0.7396468, z: 0.140013} + m_Children: [] + m_Father: {fileID: 1101810178173332474} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2220002712130868091 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7629652522327332745} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5820070644628450190 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7629652522327332745} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ab9f88402c0769547a2c7a090f1af6d9, 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 +--- !u!65 &3039296476964889407 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7629652522327332745} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/PlayerIndicator.prefab.meta b/Assets/Prefabs/PlayerIndicator.prefab.meta new file mode 100644 index 0000000..565290d --- /dev/null +++ b/Assets/Prefabs/PlayerIndicator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dab0478d3b2020af4b585450d724e245 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/GridTest.meta b/Assets/Scenes/GridTest.meta new file mode 100644 index 0000000..02065d1 --- /dev/null +++ b/Assets/Scenes/GridTest.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b39b8abf460459aa48ebf065114aaf4a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/GridTest.unity b/Assets/Scenes/GridTest.unity new file mode 100644 index 0000000..9aa3422 --- /dev/null +++ b/Assets/Scenes/GridTest.unity @@ -0,0 +1,803 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 0.95 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.18028334, g: 0.22571343, b: 0.30692208, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 112000000, guid: 884a00cdf8f10f7d9b35ed0e79133b3a, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &17071637 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 17071639} + - component: {fileID: 17071638} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &17071638 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 17071637} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &17071639 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 17071637} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 1.29, y: 6.92, z: -2.22} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &769384963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 769384968} + - component: {fileID: 769384967} + - component: {fileID: 769384966} + - component: {fileID: 769384965} + - component: {fileID: 769384964} + - component: {fileID: 769384969} + m_Layer: 0 + m_Name: HopperExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &769384964 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 38fd45c0c01b83cd78e53d3e19e28c9b, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 1 +--- !u!65 &769384965 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &769384966 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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 +--- !u!33 &769384967 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &769384968 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.91, y: 0, z: 1.34} + m_LocalScale: {x: 0.79838, y: 0.79838, z: 0.79838} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &769384969 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 769384963} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4fb156b0e1f42516bf021b2a8e9b8b8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &825819305 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 825819308} + - component: {fileID: 825819307} + - component: {fileID: 825819306} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &825819306 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825819305} + m_Enabled: 1 +--- !u!20 &825819307 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825819305} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &825819308 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825819305} + m_LocalRotation: {x: 0.49999994, y: 0.5, z: -0.5000003, w: 0.4999998} + m_LocalPosition: {x: 0, y: 6.63, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 180, z: 89.99999} +--- !u!1 &1640058004 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1640058010} + - component: {fileID: 1640058009} + - component: {fileID: 1640058008} + - component: {fileID: 1640058007} + - component: {fileID: 1640058006} + - component: {fileID: 1640058005} + m_Layer: 0 + m_Name: AnimatedExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1640058005 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5bd11d9d35311785f98a9a865047857c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1640058006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 38fd45c0c01b83cd78e53d3e19e28c9b, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 1 +--- !u!65 &1640058007 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1640058008 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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 +--- !u!33 &1640058009 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1640058010 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1640058004} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.94, y: 0, z: -0.75} + m_LocalScale: {x: 0.75521, y: 0.75521, z: 0.75521} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1940135309 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1940135315} + - component: {fileID: 1940135314} + - component: {fileID: 1940135313} + - component: {fileID: 1940135312} + - component: {fileID: 1940135311} + - component: {fileID: 1940135310} + m_Layer: 0 + m_Name: SnapperExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1940135310 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0f9e3403e99c43a288dd277fb46d5206, type: 3} + m_Name: + m_EditorClassIdentifier: + stepDuration: 0.5 +--- !u!114 &1940135311 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 38fd45c0c01b83cd78e53d3e19e28c9b, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 1 +--- !u!65 &1940135312 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1940135313 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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 +--- !u!33 &1940135314 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1940135315 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940135309} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.8, y: 0, z: 0.02} + m_LocalScale: {x: 0.74, y: 0.74, z: 0.74} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1606325940500838668 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6466675777360773743, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_Name + value: Grid World + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6159513309455308054, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5166608720900095202, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: cellSize + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5166608720900095202, guid: cc76d76453b9adefe9c6bb2dd95e66b3, + type: 3} + propertyPath: neutralZone + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: cc76d76453b9adefe9c6bb2dd95e66b3, type: 3} +--- !u!1001 &4448783347906188688 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4448783347927182947, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_Name + value: Physical Grid + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4448783347927182949, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2e87a1b846fe65befb6b8f3b8a0aa6bf, type: 3} diff --git a/Assets/Scenes/GridTest.unity.meta b/Assets/Scenes/GridTest.unity.meta new file mode 100644 index 0000000..1edc07f --- /dev/null +++ b/Assets/Scenes/GridTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7061b8f661c5fdc0dbe18b71fc0b7dad +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/GridTest/LightingData.asset b/Assets/Scenes/GridTest/LightingData.asset new file mode 100644 index 0000000..c886b37 Binary files /dev/null and b/Assets/Scenes/GridTest/LightingData.asset differ diff --git a/Assets/Scenes/GridTest/LightingData.asset.meta b/Assets/Scenes/GridTest/LightingData.asset.meta new file mode 100644 index 0000000..ad49b39 --- /dev/null +++ b/Assets/Scenes/GridTest/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 884a00cdf8f10f7d9b35ed0e79133b3a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 112000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/GridTest/ReflectionProbe-0.exr b/Assets/Scenes/GridTest/ReflectionProbe-0.exr new file mode 100644 index 0000000..9c1ed78 Binary files /dev/null and b/Assets/Scenes/GridTest/ReflectionProbe-0.exr differ diff --git a/Assets/Scenes/GridTest/ReflectionProbe-0.exr.meta b/Assets/Scenes/GridTest/ReflectionProbe-0.exr.meta new file mode 100644 index 0000000..a88778b --- /dev/null +++ b/Assets/Scenes/GridTest/ReflectionProbe-0.exr.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 641880590aa893d9fb579c7b38f0b7a2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 1 + seamlessCubemap: 1 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 100 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 0000000..9a78ad0 --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1963532d529281b982aca4f76e5e5f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AnimatedExample.cs b/Assets/Scripts/AnimatedExample.cs new file mode 100644 index 0000000..af8017f --- /dev/null +++ b/Assets/Scripts/AnimatedExample.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// One option for doing movement in the game is having enemies capable of performing arbitrary +/// animations and then updating their cell position based on where they are currently positioned. +/// This is nice and simple but can cause problems with enemies overlapping each other on screen +/// and thus not having properly updated grid positions. +public class AnimatedExample : MonoBehaviour { + GridDweller dweller; + float timer = 0.0f; + void Start() { + dweller = GetComponent(); + } + + // Update is called once per frame + void Update() { + timer += Time.deltaTime; + // Move the position of our object. + gameObject.transform.position = + Vector3.forward * Mathf.Sin(timer) * 5.0f + + Vector3.left * Mathf.Cos(timer * 5); + // Update which cell we are currently in. + dweller.SyncCellPositionToRealPosition(); + } +} diff --git a/Assets/Scripts/AnimatedExample.cs.meta b/Assets/Scripts/AnimatedExample.cs.meta new file mode 100644 index 0000000..32a9731 --- /dev/null +++ b/Assets/Scripts/AnimatedExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bd11d9d35311785f98a9a865047857c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GridDweller.cs b/Assets/Scripts/GridDweller.cs new file mode 100644 index 0000000..64a08c1 --- /dev/null +++ b/Assets/Scripts/GridDweller.cs @@ -0,0 +1,97 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class GridDweller : MonoBehaviour { + public DwellerType type = DwellerType.Player; + + private GridWorld dwellsOn; + private CellPosition position = null; + private float animTimer = 0.0f, animDuration = 0.0f, animDelay = 0.0f; + private bool animating = false; + Vector3 animStart, animEnd; + + private void Start() { + dwellsOn = GridWorld.getInstance(); + } + + void StartAt(CellPosition position) { + Start(); + MoveToCell(position); + SyncRealPositionToCellPosition(); + } + + // Update is called once per frame + void Update() { + animTimer += Time.deltaTime; + if (animating && animTimer > animDelay) { + // We only need to animate the X and Z axes, so make the code agnostic to any changes + // in the Y value. + if (animTimer < (animDelay + animDuration)) { + float progress = (animTimer - animDelay) / animDuration; + float oldY = gameObject.transform.position.y; + gameObject.transform.position = Vector3.Lerp(animStart, animEnd, progress); + SyncCellPositionToRealPosition(); + } else { + animEnd.y = gameObject.transform.position.y; + gameObject.transform.position = animEnd; + animating = false; + } + } + } + + public void AnimateToCell(CellPosition position, float delay, float duration) { + animTimer = 0.0f; + animDelay = delay; + animDuration = duration; + animStart = gameObject.transform.position; + animEnd = dwellsOn.GetRealPosition(position); + animating = true; + } + + /// + /// Moves the real (screen) position of this object to whatever its position in the grid world + /// is. (Grid world position is set with MoveToCell()). Call this if you want changes made with + /// MoveToCell() to be reflected verbatim on screen. + /// + public void SyncRealPositionToCellPosition() { + if (position != null) { + gameObject.transform.position = dwellsOn.GetRealPosition(position); + } + } + + /// + /// Determines which cell the object is occupying based on its real (screen) position and then + /// moves this object's cell position to that cell. Call this if you want manual changes to the + /// object's position to be reflected in the game logic. + /// + public void SyncCellPositionToRealPosition() { + MoveToCell(dwellsOn.GridizeRealPosition(gameObject.transform.position)); + } + + /// + /// Tries to move to a different cell on the grid. Note that this does NOT change the REAL + /// position of the object. It will appear in the same position in the world. This method just + /// changes which cell it is marked as occupying. If null is passed as newPosition, the object + /// will be effectively 'removed' from the grid world. Moving to a non-null cell will 'place' + /// the object back in the world. + /// + /// + public void MoveToCell(CellPosition newPosition) { + if (newPosition == position) return; + if (position != null) dwellsOn.RemoveDwellerFromCell(position, this); + position = newPosition; + if (position != null) dwellsOn.AddDwellerToCell(position, this); + } + + /// + /// Like MoveToCell(CellPosition), but moves to a different position on whatever side of the + /// world this object is already on. For example, if the object is on the Enemy side, it will + /// try to move to the cell on the enemy side with the specified coordinates. + /// + /// + /// + public void MoveToCell(uint x, uint z) { + MoveToCell(new CellPosition(x, z, position.side)); + } +} diff --git a/Assets/Scripts/GridDweller.cs.meta b/Assets/Scripts/GridDweller.cs.meta new file mode 100644 index 0000000..d237e63 --- /dev/null +++ b/Assets/Scripts/GridDweller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38fd45c0c01b83cd78e53d3e19e28c9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GridWorld.cs b/Assets/Scripts/GridWorld.cs new file mode 100644 index 0000000..57e8fe6 --- /dev/null +++ b/Assets/Scripts/GridWorld.cs @@ -0,0 +1,329 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +public enum DwellerType { + Player, + Enemy +} + +public enum GridClass { + PlayerGrid, + EnemyGrid +} + +[Serializable] +public class CellPosition { + public uint x, z; + public GridClass side; + + public CellPosition() { + this.x = 0; + this.z = 0; + this.side = GridClass.PlayerGrid; + } + + public CellPosition(uint x, uint z, GridClass side) { + this.x = x; + this.z = z; + this.side = side; + } +} + +public class InvalidCellPositionException : Exception { + public InvalidCellPositionException(CellPosition position, GridWorld world) + : base(String.Format( + "Grid position ({0},{1}) is outside the bounds of ({2},{3})", + position.x, + position.z, + world.width, + world.length + )) + { } +} + +/// Holds data for the in-game grid, like which squares are occupied. It is not responsible for +/// drawing this information inside the game. Instead, other objects can use helper methods from +/// this class to determine which grid squares are occupied and present graphics accordingly. +public class GridWorld : MonoBehaviour { + public float cellSize = 1.0f, neutralZone = 4.0f; + public int width = 4, length = 4; + private List[,] playerSideContents, enemySideContents; + private static GridWorld instance; + + public static GridWorld getInstance() { + if (instance == null) { + throw new NullReferenceException("No grid world exists in this level."); + } + return instance; + } + + void Awake() { + + /// We need to put this in Awake() because GridDwellers will try and place themselves on the + /// grid with Start(), so the arrays that hold that data needs to be initialized before any + /// Start() methods run. + + instance = this; + playerSideContents = new List[width, length]; + enemySideContents = new List[width, length]; + for (uint x = 0; x < width; x++) { + for (uint z = 0; z < length; z++) { + playerSideContents[x, z] = new List(); + enemySideContents[x, z] = new List(); + } + } + } + + /// + /// Returns false if CellPosition is outside the bounds of this grid world. + /// + /// + /// + public bool IsValid(CellPosition cellPosition) { + return cellPosition.x < width && cellPosition.z < length; + } + + public int ItemCountInCell(CellPosition position) { + if (!IsValid(position)) { + throw new InvalidCellPositionException(position, this); + } + if (position.side == GridClass.PlayerGrid) { + return playerSideContents[position.x, position.z].Count; + } else { + return enemySideContents[position.x, position.z].Count; + } + } + + public bool IsTypeInCell(CellPosition position, DwellerType type) { + if (!IsValid(position)) { + throw new InvalidCellPositionException(position, this); + } + if (position.side == GridClass.PlayerGrid) { + return playerSideContents[position.x, position.z].Exists( + delegate(GridDweller dweller) { return dweller.type == type; } + ); + } else { + return enemySideContents[position.x, position.z].Exists( + delegate(GridDweller dweller) { return dweller.type == type; } + ); + } + } + + public bool IsCellEmpty(CellPosition position) { + return ItemCountInCell(position) == 0; + } + + /// + /// If one can be found, returns the position of a cell on the specified side which does not + /// contain the specified type of dweller. If none can be found, null is returned instead. + /// + public CellPosition FindRandomCellWithout(DwellerType type, GridClass side) { + List allCells = ListAllCellsOnSide(side); + allCells.Shuffle(); + foreach (CellPosition position in allCells) { + if (!IsTypeInCell(position, type)) { + return position; + } + } + return null; + } + + /// + /// This method should only be used by GridDweller. Use that component to represent something on + /// the grid. Never interact with this method directly. Throws an exception if trying to set + /// a non-emtpy cell to something non-empty, or if trying to set an empty cell as empty again. + /// + public void AddDwellerToCell(CellPosition position, GridDweller dweller) { + if (position.side == GridClass.PlayerGrid) { + playerSideContents[position.x, position.z].Add(dweller); + } else { + enemySideContents[position.x, position.z].Add(dweller); + } + } + + /// + /// This method should only be used by GridDweller. Use that component to represent something on + /// the grid. Never interact with this method directly. Throws an exception if trying to set + /// a non-emtpy cell to something non-empty, or if trying to set an empty cell as empty again. + /// + public void RemoveDwellerFromCell(CellPosition position, GridDweller dweller) { + if (position.side == GridClass.PlayerGrid) { + playerSideContents[position.x, position.z].Remove(dweller); + } else { + enemySideContents[position.x, position.z].Remove(dweller); + } + } + + /// + /// Returns a list containing one CellPosition for every cell in the grid world. + /// + public List ListAllCells() { + List result = new List(); + for (uint x = 0; x < width; x++) { + for (uint z = 0; z < length; z++) { + result.Add(new CellPosition(x, z, GridClass.PlayerGrid)); + result.Add(new CellPosition(x, z, GridClass.EnemyGrid)); + } + } + return result; + } + + /// + /// Returns a list containing one CellPosition for every cell on the specified side. + /// + public List ListAllCellsOnSide(GridClass side) { + List result = new List(); + for (uint x = 0; x < width; x++) { + for (uint z = 0; z < length; z++) { + result.Add(new CellPosition(x, z, side)); + } + } + return result; + } + + /// + /// Returns a Vector3 indicating the real-world position of the center of the specified cell. + /// Throws an InvalidCellPositionException if the provided grid position is outside the bounds + /// of this grid world. + /// + public Vector3 GetRealPosition(CellPosition cellPosition) { + if (!IsValid(cellPosition)) { + throw new InvalidCellPositionException(cellPosition, this); + } + Vector3 position = Vector3.zero; + if (cellPosition.side == GridClass.PlayerGrid) { + // Player grid is in the -Z direction. + position += Vector3.back * (neutralZone / 2 + cellSize * length); + } else { + // Enemy grid is in the +Z direction. + position += Vector3.forward * neutralZone / 2; + } + position += Vector3.left * (cellSize * width / 2); + // Position is now at the negative X, Z corner of whichever side cellPosition is on. + + // Add in an offset based on the actual x and z coordinates of cellPosition. At the same + // time, add an offset of (cellSize / 2) so that we are centered in the middle of the cell. + position += Vector3.right * (cellSize * cellPosition.x + cellSize / 2); + position += Vector3.forward * (cellSize * cellPosition.z + cellSize / 2); + + return position; + } + + /// + /// Attempts to determine which cell the given world position lies in. If it is not inside the + /// bounds of either the player or enemy grid, null is returned instead. + /// + public CellPosition GridizeRealPosition(Vector3 realPosition) { + bool isOnEnemyGrid = realPosition.z > 0; // Enemy grid is in the +z direction. + // Reorient the coordinate system so that 0, 0 is at the 0, 0 corner of the enemy grid + if (isOnEnemyGrid) { + realPosition -= Vector3.forward * (neutralZone / 2); + realPosition += Vector3.right * (cellSize * width / 2); + } else { // Player grid is in the -z direction; + realPosition -= Vector3.back * (neutralZone / 2); + realPosition -= Vector3.back * (cellSize * length); + realPosition += Vector3.right * (cellSize * width / 2); + } + // Scale the coordinate system so each cell is one square unit. + realPosition /= cellSize; + // Floor to find out which integer cell we are in. + int x = Mathf.FloorToInt(realPosition.x), z = Mathf.FloorToInt(realPosition.z); + // If we are out of bounds, return false. + if (x < 0 || z < 0 || x >= width || z >= width) { + return null; + } + // Otherwise, package up the coordinates we found. + return new CellPosition( + // V V We already checked that they are >= 0, so this cast is safe. + (uint) x, (uint) z, isOnEnemyGrid ? GridClass.EnemyGrid : GridClass.PlayerGrid + ); + } + + void OnDrawGizmos() { + Vector3 neutralZoneOffset = Vector3.forward * (neutralZone / 2); + Vector3 totalLength = Vector3.forward * (cellSize * length); + Vector3 totalWidth = Vector3.right * (cellSize * width); + Vector3 cellWidth = Vector3.right * cellSize; + Vector3 cellLength = Vector3.forward * cellSize; + + // Negative X, negative Z corner of the player's grid. + Vector3 playerGridCorner = -neutralZoneOffset - totalLength - totalWidth / 2; + Gizmos.color = Color.blue; + Gizmos.DrawLine( + playerGridCorner, + playerGridCorner + (Vector3.left + Vector3.back) * (cellSize / 5) + ); + // <= because we also want to draw a line on the right-hand side of the last grid cell. + for (int x = 0; x <= width; x++) { + Gizmos.DrawLine( + playerGridCorner + cellWidth * x, + playerGridCorner + cellWidth * x + totalLength + ); + } + for (int z = 0; z <= length; z++) { + Gizmos.DrawLine( + playerGridCorner + cellLength * z, + playerGridCorner + cellLength * z + totalWidth + ); + } + if (playerSideContents != null) { + for (int x = 0; x < width; x++) { + for (int z = 0; z < length; z++) { + Vector3 pos = playerGridCorner + cellWidth * x + cellLength * z; + pos += (Vector3.right + Vector3.forward) * (cellSize / 2); + foreach (GridDweller dweller in playerSideContents[x, z]) { + DrawDwellerTypeGizmo(pos, dweller.type); + // Stack multiple items on the same cell. + pos += Vector3.up * 0.5f; + } + } + } + } + + // Negative X, negative Z corner of the enemy grid. + Vector3 enemyGridCorner = neutralZoneOffset - totalWidth / 2; + Gizmos.color = Color.red; + Gizmos.DrawLine( + enemyGridCorner, + enemyGridCorner + (Vector3.left + Vector3.back) * (cellSize / 5) + ); + // <= because we also want to draw a line on the right-hand side of the last grid cell. + for (int x = 0; x <= width; x++) { + Gizmos.DrawLine( + enemyGridCorner + cellWidth * x, + enemyGridCorner + cellWidth * x + totalLength + ); + } + for (int z = 0; z <= length; z++) { + Gizmos.DrawLine( + enemyGridCorner + cellLength * z, + enemyGridCorner + cellLength * z + totalWidth + ); + } + if (enemySideContents != null) { + for (int x = 0; x < width; x++) { + for (int z = 0; z < length; z++) { + Vector3 pos = enemyGridCorner + cellWidth * x + cellLength * z; + pos += (Vector3.right + Vector3.forward) * (cellSize / 2); + foreach (GridDweller dweller in enemySideContents[x, z]) { + DrawDwellerTypeGizmo(pos, dweller.type); + // Stack multiple items on the same cell. + pos += Vector3.up * 0.5f; + } + } + } + } + } + + void DrawDwellerTypeGizmo(Vector3 position, DwellerType type) { + if (type == DwellerType.Player) { + Gizmos.color = Color.blue; + } else if (type == DwellerType.Enemy) { + Gizmos.color = Color.red; + } + + Gizmos.DrawLine(position, position + Vector3.up * 5); + Gizmos.DrawCube(position + Vector3.up * 3, new Vector3(0.2f, 0.2f, 0.2f)); + } +} diff --git a/Assets/Scripts/GridWorld.cs.meta b/Assets/Scripts/GridWorld.cs.meta new file mode 100644 index 0000000..0bcb139 --- /dev/null +++ b/Assets/Scripts/GridWorld.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c1492f8fc8e71355ae6643b3dba3cdf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/HopperExample.cs b/Assets/Scripts/HopperExample.cs new file mode 100644 index 0000000..451f8f7 --- /dev/null +++ b/Assets/Scripts/HopperExample.cs @@ -0,0 +1,72 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +enum Mode { + Wait, + Animate, +} + + +/// One option is to pick a grid square to move to and play an animation to get there. This is the +/// most complicated option but I think it would be worth it. +public class HopperExample : MonoBehaviour { + const float WAIT_TIME = 1.0f; + const float ANIMATE_TIME = 0.5f; + const float ANIMATION_HEIGHT = 3.0f; + GridDweller dweller; + CellPosition[] patrol = { + new CellPosition(0, 0, GridClass.EnemyGrid), + new CellPosition(2, 0, GridClass.EnemyGrid), + new CellPosition(2, 2, GridClass.EnemyGrid), + new CellPosition(0, 2, GridClass.EnemyGrid), + new CellPosition(3, 3, GridClass.EnemyGrid), + new CellPosition(1, 3, GridClass.EnemyGrid), + new CellPosition(1, 1, GridClass.EnemyGrid), + new CellPosition(3, 1, GridClass.EnemyGrid), + }; + Mode mode = Mode.Wait; + uint patrolStep = 0; + float timer = 0.0f; + + void Start() { + dweller = GetComponent(); + } + + /// Roots at x=0 and x=1, vertex at (0.5, 1.0). + float ParabolicCurve(float progress) { + return 1.0f - Mathf.Pow(2 * progress - 1, 2.0f); + } + + void Update() { + timer += Time.deltaTime; + + if (mode == Mode.Wait && timer >= WAIT_TIME) { + // Wait time is over, fire up the animation. + timer -= WAIT_TIME; + mode = Mode.Animate; + // Start the anim at the current position... + patrolStep++; + if (patrolStep >= patrol.Length) { + patrolStep = 0; + } + dweller.AnimateToCell(patrol[patrolStep], 0, ANIMATE_TIME); + } else if (mode == Mode.Animate && timer >= ANIMATE_TIME) { + timer -= ANIMATE_TIME; + mode = Mode.Wait; + + // Make sure we are on the ground once the animation ends. + Vector3 newPosition = gameObject.transform.position; + newPosition.y = 0; + gameObject.transform.position = newPosition; + } + + if (mode == Mode.Animate) { + float progress = timer / ANIMATE_TIME; + // Compute a parabolic jump animation. + Vector3 newPosition = gameObject.transform.position; + newPosition.y = ANIMATION_HEIGHT * ParabolicCurve(progress); + gameObject.transform.position = newPosition; + } + } +} diff --git a/Assets/Scripts/HopperExample.cs.meta b/Assets/Scripts/HopperExample.cs.meta new file mode 100644 index 0000000..b583ae9 --- /dev/null +++ b/Assets/Scripts/HopperExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4fb156b0e1f42516bf021b2a8e9b8b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ListShuffle.cs b/Assets/Scripts/ListShuffle.cs new file mode 100644 index 0000000..f553505 --- /dev/null +++ b/Assets/Scripts/ListShuffle.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +public static class ListShuffle { + private static Random rng = new Random(); + + public static void Shuffle(this IList list) { + int n = list.Count; + while (n > 1) { + n--; + int k = rng.Next(n + 1); + T value = list[k]; + list[k] = list[n]; + list[n] = value; + } + } +} diff --git a/Assets/Scripts/ListShuffle.cs.meta b/Assets/Scripts/ListShuffle.cs.meta new file mode 100644 index 0000000..93a21c3 --- /dev/null +++ b/Assets/Scripts/ListShuffle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 333376e58f8311aa7ad93d4844090741 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PhysicalGrid.cs b/Assets/Scripts/PhysicalGrid.cs new file mode 100644 index 0000000..69e248b --- /dev/null +++ b/Assets/Scripts/PhysicalGrid.cs @@ -0,0 +1,81 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +class PhysicalCell { + public Vector3 position; + public GameObject playerIndicator = null; + public GameObject enemyIndicator = null; +} + +public class PhysicalGrid : MonoBehaviour { + [Tooltip( + "This prefab will be instantiated for every single cell in the grid. The prefab should be " + + "1 unit big, and will be scaled to the actual size of the grid." + )] + public GameObject cellPrefab; + [Tooltip( + "This prefab will be instantiated for every cell containing a player. The prefab should be " + + "1 unit big, and will be scaled to the actual size of the grid." + )] + public GameObject playerIndicator; + [Tooltip( + "This prefab will be instantiated for every cell containing an enemy. The prefab should be " + + "1 unit big, and will be scaled to the actual size of the grid." + )] + public GameObject enemyIndicator; + + private List allCells; + private List physicalCells = new List(); + private GridWorld gridWorld; + + /// + /// Handles scaling the prefab to match the grid world's cell size. + /// + /// + /// + /// + GameObject Instantiate(GameObject original, Vector3 position) { + GameObject instance = Instantiate(original, position, Quaternion.identity, gameObject.transform); + instance.transform.localScale = Vector3.one * gridWorld.cellSize; + return instance; + } + + void Start() { + gridWorld = GridWorld.getInstance(); + allCells = gridWorld.ListAllCells(); + foreach (CellPosition cell in allCells) { + PhysicalCell physicalCell = new PhysicalCell(); + physicalCell.position = gridWorld.GetRealPosition(cell); + Instantiate(cellPrefab, physicalCell.position); + physicalCells.Add(physicalCell); + } + } + + void Update() { + for (int i = 0; i < allCells.Count; i++) { + CellPosition cellPosition = allCells[i]; + PhysicalCell physicalCell = physicalCells[i]; + + if (gridWorld.IsTypeInCell(cellPosition, DwellerType.Player)) { + if (physicalCell.playerIndicator == null) physicalCell.playerIndicator = + Instantiate(playerIndicator, physicalCell.position); + } else { + if (physicalCell.playerIndicator != null) { + Destroy(physicalCell.playerIndicator); + physicalCell.playerIndicator = null; + } + } + + if (gridWorld.IsTypeInCell(cellPosition, DwellerType.Enemy)) { + if (physicalCell.enemyIndicator == null) physicalCell.enemyIndicator = + Instantiate(enemyIndicator, physicalCell.position); + } else { + if (physicalCell.enemyIndicator != null) { + Destroy(physicalCell.enemyIndicator); + physicalCell.enemyIndicator = null; + } + } + } + } +} diff --git a/Assets/Scripts/PhysicalGrid.cs.meta b/Assets/Scripts/PhysicalGrid.cs.meta new file mode 100644 index 0000000..b8e3dfa --- /dev/null +++ b/Assets/Scripts/PhysicalGrid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e564f9337cfd99775b8afcf9a56f82ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SnappyExample.cs b/Assets/Scripts/SnappyExample.cs new file mode 100644 index 0000000..a9cc3b2 --- /dev/null +++ b/Assets/Scripts/SnappyExample.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// One option for doing movement in the game is to rigidly lock the enemies to a grid. This is +/// simple but results in clunky animation. +public class SnappyExample : MonoBehaviour { + GridDweller dweller; + CellPosition[] patrol = { + new CellPosition(0, 0, GridClass.PlayerGrid), + new CellPosition(1, 0, GridClass.PlayerGrid), + new CellPosition(2, 0, GridClass.PlayerGrid), + new CellPosition(3, 0, GridClass.PlayerGrid), + new CellPosition(3, 1, GridClass.PlayerGrid), + new CellPosition(3, 2, GridClass.PlayerGrid), + new CellPosition(3, 3, GridClass.PlayerGrid), + new CellPosition(2, 3, GridClass.PlayerGrid), + new CellPosition(1, 3, GridClass.PlayerGrid), + new CellPosition(0, 3, GridClass.PlayerGrid), + new CellPosition(0, 2, GridClass.PlayerGrid), + new CellPosition(0, 1, GridClass.PlayerGrid), + }; + float timer = 0.0f; + public float stepDuration = 0.5f; + + void Start() { + dweller = GetComponent(); + } + + void Update() { + timer += Time.deltaTime; + if (timer > patrol.Length * stepDuration) { + timer -= patrol.Length * stepDuration; + } + + // Set our position on the grid. This does not change our "real" aka "screen" position. + dweller.MoveToCell(patrol[Mathf.FloorToInt(timer / stepDuration)]); + // Set our real position to mimic our grid position. + dweller.SyncRealPositionToCellPosition(); + } +} diff --git a/Assets/Scripts/SnappyExample.cs.meta b/Assets/Scripts/SnappyExample.cs.meta new file mode 100644 index 0000000..d0a74e1 --- /dev/null +++ b/Assets/Scripts/SnappyExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f9e3403e99c43a288dd277fb46d5206 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/Resources/SteamVR_Settings.asset b/Assets/SteamVR/Resources/SteamVR_Settings.asset index 532c853..9b8722d 100644 --- a/Assets/SteamVR/Resources/SteamVR_Settings.asset +++ b/Assets/SteamVR/Resources/SteamVR_Settings.asset @@ -24,7 +24,7 @@ MonoBehaviour: autoEnableVR: 1 legacyMixedRealityCamera: 1 mixedRealityCameraPose: - actionPath: /actions//in/ExternalCamera - needsReinit: 1 + actionPath: /actions/mixedreality/in/ExternalCamera + needsReinit: 0 mixedRealityCameraInputSource: 11 mixedRealityActionSetAutoEnable: 1