Browse Source

Work on darkness + added 2d Sprite packages

jeff
Joshua Reason 10 months ago
parent
commit
500253b9c0
73 changed files with 5454 additions and 231 deletions
  1. +6
    -0
      .vsconfig
  2. +44
    -0
      Assets/Art Assets/Materials/AlphaMask.mat
  3. +2
    -2
      Assets/Art Assets/Materials/AlphaMask.mat.meta
  4. +8
    -0
      Assets/Art Assets/Shaders/Render Textures.meta
  5. +38
    -0
      Assets/Art Assets/Shaders/Render Textures/Light Mask.renderTexture
  6. +2
    -2
      Assets/Art Assets/Shaders/Render Textures/Light Mask.renderTexture.meta
  7. +8
    -0
      Assets/Art Assets/Textures/Test Assets.meta
  8. BIN
      Assets/Art Assets/Textures/Test Assets/sand.png
  9. +2100
    -0
      Assets/Art Assets/Textures/Test Assets/sand.png.meta
  10. +1158
    -0
      Assets/Art Assets/Textures/dark_castle_tileset.png.meta
  11. BIN
      Assets/Art Assets/Textures/tiles.png
  12. +0
    -144
      Assets/Art Assets/Textures/tiles.png.meta
  13. +8
    -0
      Assets/Art Assets/Tilemaps.meta
  14. +8
    -0
      Assets/Art Assets/Tilemaps/Environment.meta
  15. +227
    -0
      Assets/Art Assets/Tilemaps/Environment/Dark Castle.prefab
  16. +7
    -0
      Assets/Art Assets/Tilemaps/Environment/Dark Castle.prefab.meta
  17. +8
    -0
      Assets/Art Assets/Tilemaps/Environment/DarkCastle.meta
  18. BIN
      Assets/Art Assets/Tilemaps/Environment/DarkCastle/Bricks.asset
  19. +1
    -1
      Assets/Art Assets/Tilemaps/Environment/DarkCastle/Bricks.asset.meta
  20. BIN
      Assets/Art Assets/Tilemaps/Environment/DarkCastle/dark_castle_tileset_1.asset
  21. +1
    -1
      Assets/Art Assets/Tilemaps/Environment/DarkCastle/dark_castle_tileset_1.asset.meta
  22. +8
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet.meta
  23. +8
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles.meta
  24. BIN
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles/SandBlock.asset
  25. +1
    -1
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles/SandBlock.asset.meta
  26. +213
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/SandBlocks.prefab
  27. +7
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/SandBlocks.prefab.meta
  28. +213
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/Sand_Test.prefab
  29. +7
    -0
      Assets/Art Assets/Tilemaps/Environment/Test Pallet/Sand_Test.prefab.meta
  30. BIN
      Assets/Scenes/2D Test Scene.unity
  31. BIN
      Assets/Scenes/Josh Test Scene.unity
  32. +1
    -1
      Assets/Scenes/Josh Test Scene.unity.meta
  33. +8
    -0
      Assets/Scripts/Character.meta
  34. +147
    -0
      Assets/Scripts/Character/CharacterController2D.cs
  35. +11
    -0
      Assets/Scripts/Character/CharacterController2D.cs.meta
  36. +44
    -0
      Assets/Scripts/Character/CharacterInputController.cs
  37. +11
    -0
      Assets/Scripts/Character/CharacterInputController.cs.meta
  38. +77
    -0
      Assets/Scripts/DarknessController.cs
  39. +11
    -0
      Assets/Scripts/DarknessController.cs.meta
  40. +8
    -0
      Assets/Scripts/Effects.meta
  41. +34
    -0
      Assets/Scripts/Effects/ApplyImageEffect.cs
  42. +11
    -0
      Assets/Scripts/Effects/ApplyImageEffect.cs.meta
  43. +28
    -0
      Assets/Scripts/Float.cs
  44. +11
    -0
      Assets/Scripts/Float.cs.meta
  45. +8
    -0
      Assets/Scripts/RenderPass.meta
  46. +8
    -0
      Assets/Scripts/Shaders.meta
  47. +54
    -0
      Assets/Scripts/Shaders/AlphaMask.shader
  48. +10
    -0
      Assets/Scripts/Shaders/AlphaMask.shader.meta
  49. +65
    -0
      Assets/Scripts/Shaders/DarknessEffect.shader
  50. +10
    -0
      Assets/Scripts/Shaders/DarknessEffect.shader.meta
  51. +86
    -0
      Assets/Scripts/Shaders/Image.mat
  52. +2
    -2
      Assets/Scripts/Shaders/Image.mat.meta
  53. +271
    -0
      Assets/Settings/PlayerInput.cs
  54. +11
    -0
      Assets/Settings/PlayerInput.cs.meta
  55. +162
    -0
      Assets/Settings/PlayerInput.inputactions
  56. +14
    -0
      Assets/Settings/PlayerInput.inputactions.meta
  57. BIN
      Assets/Settings/Renderers/Forward Renderer.asset
  58. BIN
      Assets/Settings/Renderers/Forward Renderer_Renderer.asset
  59. BIN
      Assets/Settings/Renderers/ForwardRenderer.asset
  60. BIN
      Assets/Settings/Renderers/SampleSceneProfile.asset
  61. BIN
      Assets/Settings/Renderers/UniversalRP-HighQuality.asset
  62. BIN
      Assets/Settings/Renderers/UniversalRP-LowQuality.asset
  63. BIN
      Assets/Settings/Renderers/UniversalRP-MediumQuality.asset
  64. +0
    -8
      Assets/Settings/Renderers/UniversalRP-MediumQuality.asset.meta
  65. BIN
      Assets/Settings/Renderers/UniversalRenderPipeline 2D.asset
  66. BIN
      Assets/dark_castle_tileset_10.asset
  67. +2
    -2
      Assets/dark_castle_tileset_10.asset.meta
  68. +6
    -1
      Packages/manifest.json
  69. +70
    -31
      Packages/packages-lock.json
  70. BIN
      ProjectSettings/PackageManagerSettings.asset
  71. BIN
      ProjectSettings/ProjectSettings.asset
  72. +167
    -0
      ProjectSettings/SceneTemplateSettings.json
  73. BIN
      ProjectSettings/TagManager.asset

+ 6
- 0
.vsconfig View File

@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

+ 44
- 0
Assets/Art Assets/Materials/AlphaMask.mat View File

@ -0,0 +1,44 @@
%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: AlphaMask
m_Shader: {fileID: 4800000, guid: 70997f99a8685d34a9333b2aab2df541, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
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}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _EnableExternalAlpha: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

Assets/Settings/Renderers/UniversalRP-HighQuality.asset.meta → Assets/Art Assets/Materials/AlphaMask.mat.meta View File

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

+ 8
- 0
Assets/Art Assets/Shaders/Render Textures.meta View File

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

+ 38
- 0
Assets/Art Assets/Shaders/Render Textures/Light Mask.renderTexture View File

@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Light Mask
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 3
m_Width: 1920
m_Height: 1080
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 2
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

Assets/Settings/Renderers/UniversalRP-LowQuality.asset.meta → Assets/Art Assets/Shaders/Render Textures/Light Mask.renderTexture.meta View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: a31e9f9f9c9d4b9429ed0d1234e22103
guid: 0df5fbf4e7b2d3240bfba78506bbd0b5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Art Assets/Textures/Test Assets.meta View File

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

BIN
Assets/Art Assets/Textures/Test Assets/sand.png (Stored with Git LFS) View File

size 1466

+ 2100
- 0
Assets/Art Assets/Textures/Test Assets/sand.png.meta
File diff suppressed because it is too large
View File


+ 1158
- 0
Assets/Art Assets/Textures/dark_castle_tileset.png.meta
File diff suppressed because it is too large
View File


BIN
Assets/Art Assets/Textures/tiles.png (Stored with Git LFS) View File

size 6185

+ 0
- 144
Assets/Art Assets/Textures/tiles.png.meta View File

@ -1,144 +0,0 @@
fileFormatVersion: 2
guid: ed75e436451f72f49bc6306cb973010f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 2
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
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: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
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:

+ 8
- 0
Assets/Art Assets/Tilemaps.meta View File

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

+ 8
- 0
Assets/Art Assets/Tilemaps/Environment.meta View File

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

+ 227
- 0
Assets/Art Assets/Tilemaps/Environment/Dark Castle.prefab View File

@ -0,0 +1,227 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3414543196202214263
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1551553666195280557}
- component: {fileID: 8897841122751686872}
m_Layer: 31
m_Name: Dark Castle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1551553666195280557
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3414543196202214263}
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: 4038538624354686538}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!156049354 &8897841122751686872
Grid:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3414543196202214263}
m_Enabled: 1
m_CellSize: {x: 1, y: 1, z: 0}
m_CellGap: {x: 0, y: 0, z: 0}
m_CellLayout: 0
m_CellSwizzle: 0
--- !u!1 &7631613625719510146
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4038538624354686538}
- component: {fileID: 8799124761045934172}
- component: {fileID: 5925201870847950590}
m_Layer: 0
m_Name: Layer1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4038538624354686538
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7631613625719510146}
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: 1551553666195280557}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1839735485 &8799124761045934172
Tilemap:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7631613625719510146}
m_Enabled: 1
m_Tiles:
- first: {x: -3, y: -1, z: 0}
second:
serializedVersion: 2
m_TileIndex: 0
m_TileSpriteIndex: 1
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
dummyAlignment: 0
m_AllTileFlags: 1073741826
- first: {x: -2, y: 0, z: 0}
second:
serializedVersion: 2
m_TileIndex: 1
m_TileSpriteIndex: 1
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
dummyAlignment: 0
m_AllTileFlags: 1073741825
m_AnimatedTiles: {}
m_TileAssetArray:
- m_RefCount: 1
m_Data: {fileID: 11400000, guid: b118855d8bae01d45a39e6d600b0e28a, type: 2}
- m_RefCount: 1
m_Data: {fileID: 11400000, guid: 748137fbd92a0fa4b98d2af8994ea3bc, type: 2}
m_TileSpriteArray:
- m_RefCount: 0
m_Data: {fileID: 0}
- m_RefCount: 2
m_Data: {fileID: 4762540610393762138, guid: 9506ba4d3ce6c244dba2cf78c848427b, type: 3}
m_TileMatrixArray:
- m_RefCount: 2
m_Data:
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_TileColorArray:
- m_RefCount: 2
m_Data: {r: 1, g: 1, b: 1, a: 1}
m_TileObjectToInstantiateArray: []
m_AnimationFrameRate: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Origin: {x: -3, y: -1, z: 0}
m_Size: {x: 3, y: 2, z: 1}
m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
m_TileOrientation: 0
m_TileOrientationMatrix:
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
--- !u!483693784 &5925201870847950590
TilemapRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7631613625719510146}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_ChunkSize: {x: 32, y: 32, z: 32}
m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
m_MaxChunkCount: 16
m_MaxFrameAge: 16
m_SortOrder: 0
m_Mode: 0
m_DetectChunkCullingBounds: 0
m_MaskInteraction: 0
--- !u!114 &1638988078725490388
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12395, guid: 0000000000000000e000000000000000, type: 0}
m_Name: Palette Settings
m_EditorClassIdentifier:
cellSizing: 0
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}

+ 7
- 0
Assets/Art Assets/Tilemaps/Environment/Dark Castle.prefab.meta View File

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

+ 8
- 0
Assets/Art Assets/Tilemaps/Environment/DarkCastle.meta View File

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

BIN
Assets/Art Assets/Tilemaps/Environment/DarkCastle/Bricks.asset (Stored with Git LFS) View File

size 1388

Assets/Settings/Renderers/Forward Renderer.asset.meta → Assets/Art Assets/Tilemaps/Environment/DarkCastle/Bricks.asset.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ec2b711c49be8ee459eb4a868069a60d
guid: b118855d8bae01d45a39e6d600b0e28a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

BIN
Assets/Art Assets/Tilemaps/Environment/DarkCastle/dark_castle_tileset_1.asset (Stored with Git LFS) View File

size 796

Assets/Settings/Renderers/Forward Renderer_Renderer.asset.meta → Assets/Art Assets/Tilemaps/Environment/DarkCastle/dark_castle_tileset_1.asset.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 90d08a3baa528564aa50eef6fa421756
guid: 6b9dc3ab2bc3f8649831cf805e901782
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

+ 8
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet.meta View File

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

+ 8
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles.meta View File

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

BIN
Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles/SandBlock.asset (Stored with Git LFS) View File

size 5960

Assets/Settings/Renderers/UniversalRenderPipeline 2D.asset.meta → Assets/Art Assets/Tilemaps/Environment/Test Pallet/Rule Tiles/SandBlock.asset.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2db04a71faa61c94eace4435baa529d2
guid: 9d0d7610475a21346958b247fd01aa0e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

+ 213
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet/SandBlocks.prefab View File

@ -0,0 +1,213 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1112622379686640754
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1123622620666524897}
- component: {fileID: 8589400848910037160}
- component: {fileID: 8131540559299094280}
m_Layer: 0
m_Name: Layer1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1123622620666524897
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1112622379686640754}
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: 6836324335940247475}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1839735485 &8589400848910037160
Tilemap:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1112622379686640754}
m_Enabled: 1
m_Tiles:
- first: {x: -1, y: 0, z: 0}
second:
serializedVersion: 2
m_TileIndex: 0
m_TileSpriteIndex: 0
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
dummyAlignment: 0
m_AllTileFlags: 1073741826
m_AnimatedTiles: {}
m_TileAssetArray:
- m_RefCount: 1
m_Data: {fileID: 11400000, guid: 9d0d7610475a21346958b247fd01aa0e, type: 2}
m_TileSpriteArray:
- m_RefCount: 1
m_Data: {fileID: -6225729356647724669, guid: 2d2e248d3114bc449bcdf92e0331f710, type: 3}
m_TileMatrixArray:
- m_RefCount: 1
m_Data:
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_TileColorArray:
- m_RefCount: 1
m_Data: {r: 1, g: 1, b: 1, a: 1}
m_TileObjectToInstantiateArray: []
m_AnimationFrameRate: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Origin: {x: -1, y: 0, z: 0}
m_Size: {x: 1, y: 1, z: 1}
m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
m_TileOrientation: 0
m_TileOrientationMatrix:
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
--- !u!483693784 &8131540559299094280
TilemapRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1112622379686640754}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_ChunkSize: {x: 32, y: 32, z: 32}
m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
m_MaxChunkCount: 16
m_MaxFrameAge: 16
m_SortOrder: 0
m_Mode: 0
m_DetectChunkCullingBounds: 0
m_MaskInteraction: 0
--- !u!1 &6680155787674334949
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6836324335940247475}
- component: {fileID: 2606639345885216978}
m_Layer: 31
m_Name: SandBlocks
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6836324335940247475
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6680155787674334949}
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: 1123622620666524897}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!156049354 &2606639345885216978
Grid:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6680155787674334949}
m_Enabled: 1
m_CellSize: {x: 1, y: 1, z: 0}
m_CellGap: {x: 0, y: 0, z: 0}
m_CellLayout: 0
m_CellSwizzle: 0
--- !u!114 &74542738918241522
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12395, guid: 0000000000000000e000000000000000, type: 0}
m_Name: Palette Settings
m_EditorClassIdentifier:
cellSizing: 0
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}

+ 7
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet/SandBlocks.prefab.meta View File

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

+ 213
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet/Sand_Test.prefab View File

@ -0,0 +1,213 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &298522739649954731
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3942731476013810067}
- component: {fileID: 8110122027874770850}
m_Layer: 31
m_Name: Sand_Test
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3942731476013810067
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 298522739649954731}
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: 7398244141578023521}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!156049354 &8110122027874770850
Grid:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 298522739649954731}
m_Enabled: 1
m_CellSize: {x: 1, y: 1, z: 0}
m_CellGap: {x: 0, y: 0, z: 0}
m_CellLayout: 0
m_CellSwizzle: 0
--- !u!1 &5880053140588868628
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7398244141578023521}
- component: {fileID: 7236300032885166215}
- component: {fileID: 7847963020574210895}
m_Layer: 0
m_Name: Layer1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7398244141578023521
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5880053140588868628}
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: 3942731476013810067}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1839735485 &7236300032885166215
Tilemap:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5880053140588868628}
m_Enabled: 1
m_Tiles:
- first: {x: -1, y: 0, z: 0}
second:
serializedVersion: 2
m_TileIndex: 0
m_TileSpriteIndex: 0
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
dummyAlignment: 0
m_AllTileFlags: 1073741826
m_AnimatedTiles: {}
m_TileAssetArray:
- m_RefCount: 1
m_Data: {fileID: 11400000, guid: 9d0d7610475a21346958b247fd01aa0e, type: 2}
m_TileSpriteArray:
- m_RefCount: 1
m_Data: {fileID: -6225729356647724669, guid: 2d2e248d3114bc449bcdf92e0331f710, type: 3}
m_TileMatrixArray:
- m_RefCount: 1
m_Data:
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_TileColorArray:
- m_RefCount: 1
m_Data: {r: 1, g: 1, b: 1, a: 1}
m_TileObjectToInstantiateArray: []
m_AnimationFrameRate: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Origin: {x: -1, y: 0, z: 0}
m_Size: {x: 1, y: 1, z: 1}
m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
m_TileOrientation: 0
m_TileOrientationMatrix:
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
--- !u!483693784 &7847963020574210895
TilemapRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5880053140588868628}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_ChunkSize: {x: 32, y: 32, z: 32}
m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
m_MaxChunkCount: 16
m_MaxFrameAge: 16
m_SortOrder: 0
m_Mode: 0
m_DetectChunkCullingBounds: 0
m_MaskInteraction: 0
--- !u!114 &1211940915615351326
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12395, guid: 0000000000000000e000000000000000, type: 0}
m_Name: Palette Settings
m_EditorClassIdentifier:
cellSizing: 0
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}

+ 7
- 0
Assets/Art Assets/Tilemaps/Environment/Test Pallet/Sand_Test.prefab.meta View File

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

BIN
Assets/Scenes/2D Test Scene.unity (Stored with Git LFS) View File

size 7798

BIN
Assets/Scenes/Josh Test Scene.unity (Stored with Git LFS) View File

size 151215

Assets/Scenes/2D Test Scene.unity.meta → Assets/Scenes/Josh Test Scene.unity.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e61161cbdf336c84d92408cfc1052d4e
guid: 87d0e5b1ecfa9bc45bc30aac4faaf331
DefaultImporter:
externalObjects: {}
userData:

+ 8
- 0
Assets/Scripts/Character.meta View File

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

+ 147
- 0
Assets/Scripts/Character/CharacterController2D.cs View File

@ -0,0 +1,147 @@
using UnityEngine;
using UnityEngine.Events;
public class CharacterController2D : MonoBehaviour
{
[SerializeField] private float m_JumpForce = 400f; // Amount of force added when the player jumps.
[Range(0, 1)] [SerializeField] private float m_CrouchSpeed = .36f; // Amount of maxSpeed applied to crouching movement. 1 = 100%
[Range(0, .3f)] [SerializeField] private float m_MovementSmoothing = .05f; // How much to smooth out the movement
[SerializeField] private bool m_AirControl = false; // Whether or not a player can steer while jumping;
[SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character
[SerializeField] private Transform m_GroundCheck; // A position marking where to check if the player is grounded.
[SerializeField] private Transform m_CeilingCheck; // A position marking where to check for ceilings
[SerializeField] private Collider2D m_CrouchDisableCollider; // A collider that will be disabled when crouching
const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded
private bool m_Grounded; // Whether or not the player is grounded.
const float k_CeilingRadius = .2f; // Radius of the overlap circle to determine if the player can stand up
private Rigidbody2D m_Rigidbody2D;
private bool m_FacingRight = true; // For determining which way the player is currently facing.
private Vector3 m_Velocity = Vector3.zero;
[Header("Events")]
[Space]
public UnityEvent OnLandEvent;
[System.Serializable]
public class BoolEvent : UnityEvent<bool> { }
public BoolEvent OnCrouchEvent;
private bool m_wasCrouching = false;
private void Awake()
{
m_Rigidbody2D = GetComponent<Rigidbody2D>();
if (OnLandEvent == null)
OnLandEvent = new UnityEvent();
if (OnCrouchEvent == null)
OnCrouchEvent = new BoolEvent();
}
private void FixedUpdate()
{
bool wasGrounded = m_Grounded;
m_Grounded = false;
// The player is grounded if a circlecast to the groundcheck position hits anything designated as ground
// This can be done using layers instead but Sample Assets will not overwrite your project settings.
Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround);
for (int i = 0; i < colliders.Length; i++)
{
if (colliders[i].gameObject != gameObject)
{
m_Grounded = true;
if (!wasGrounded)
OnLandEvent.Invoke();
}
}
}
public void Move(float move, bool crouch, bool jump)
{
// If crouching, check to see if the character can stand up
if (!crouch)
{
// If the character has a ceiling preventing them from standing up, keep them crouching
if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))
{
crouch = true;
}
}
//only control the player if grounded or airControl is turned on
if (m_Grounded || m_AirControl)
{
// If crouching
if (crouch)
{
if (!m_wasCrouching)
{
m_wasCrouching = true;
OnCrouchEvent.Invoke(true);
}
// Reduce the speed by the crouchSpeed multiplier
move *= m_CrouchSpeed;
// Disable one of the colliders when crouching
if (m_CrouchDisableCollider != null)
m_CrouchDisableCollider.enabled = false;
}
else
{
// Enable the collider when not crouching
if (m_CrouchDisableCollider != null)
m_CrouchDisableCollider.enabled = true;
if (m_wasCrouching)
{
m_wasCrouching = false;
OnCrouchEvent.Invoke(false);
}
}
// Move the character by finding the target velocity
Vector3 targetVelocity = new Vector2(move * 10f, m_Rigidbody2D.velocity.y);
// And then smoothing it out and applying it to the character
m_Rigidbody2D.velocity = Vector3.SmoothDamp(m_Rigidbody2D.velocity, targetVelocity, ref m_Velocity, m_MovementSmoothing);
// If the input is moving the player right and the player is facing left...
if (move > 0 && !m_FacingRight)
{
// ... flip the player.
Flip();
}
// Otherwise if the input is moving the player left and the player is facing right...
else if (move < 0 && m_FacingRight)
{
// ... flip the player.
Flip();
}
}
// If the player should jump...
if (m_Grounded && jump)
{
// Add a vertical force to the player.
m_Grounded = false;
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
}
}
private void Flip()
{
// Switch the way the player is labelled as facing.
m_FacingRight = !m_FacingRight;
// Multiply the player's x local scale by -1.
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}

+ 11
- 0
Assets/Scripts/Character/CharacterController2D.cs.meta View File

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

+ 44
- 0
Assets/Scripts/Character/CharacterInputController.cs View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using NaughtyAttributes;
public class CharacterInputController : MonoBehaviour
{
[SerializeField,Header("References")]
private CharacterController2D m_characterController;
[SerializeField]
private Material m_Darkness;
[ShowNonSerializedField]
private Vector2 m_movement;
[ShowNonSerializedField]
private bool m_jump;
public void OnMove(InputAction.CallbackContext context)
{
m_movement = context.ReadValue<Vector2>();
}
public void OnJump(InputAction.CallbackContext context)
{
m_jump = context.ReadValueAsButton();
}
private void Update()
{
m_characterController.Move(m_movement.x,false ,m_jump);
}
}

+ 11
- 0
Assets/Scripts/Character/CharacterInputController.cs.meta View File

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

+ 77
- 0
Assets/Scripts/DarknessController.cs View File

@ -0,0 +1,77 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;
using Variables;
public class DarknessController : MonoBehaviour
{
[SerializeField, Header("References")]
private Material m_darknessMat;
[SerializeField]
private Reference<bool> m_isInputDown;
[SerializeField, BoxGroup("Settings")]
private float m_darknessSpeed = 0.25f;
[SerializeField, BoxGroup("Settings")]
private float m_lightSpeed = 1.0f;
[ShowNonSerializedField]
private float m_currentDarknessLevel;
private bool m_isDarknessChanging;
private void OnEnable()
{
m_isInputDown.OnValueChanged += OnInputChange;
}
private void OnDisable()
{
m_isInputDown.OnValueChanged -= OnInputChange;
}
private void OnInputChange(bool value)
{
StopAllCoroutines();
if (value)
StartCoroutine(ChangeDarkness(0, m_darknessSpeed));
else
StartCoroutine(ChangeDarkness(1, m_lightSpeed));
}
private IEnumerator ChangeDarkness(float end, float time)
{
yield return StartCoroutine(ChangeDarkness(end, time, AnimationCurve.Linear(0, 0, 1, 1)));
}
private IEnumerator ChangeDarkness(float end, float time, AnimationCurve curve)
{
float start = m_currentDarknessLevel;
float elapsedTime = 0;
time = Mathf.InverseLerp(start, end, m_currentDarknessLevel);
m_isDarknessChanging = true;
while(elapsedTime < time)
{
m_currentDarknessLevel = Mathf.Lerp(start, end, curve.Evaluate(elapsedTime / time));
m_darknessMat.SetFloat("_Apply", m_currentDarknessLevel);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}
m_isDarknessChanging = false;
m_currentDarknessLevel = end;
}
}

+ 11
- 0
Assets/Scripts/DarknessController.cs.meta View File

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

+ 8
- 0
Assets/Scripts/Effects.meta View File

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

+ 34
- 0
Assets/Scripts/Effects/ApplyImageEffect.cs View File

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteAlways]
public class ApplyImageEffect : MonoBehaviour
{
[SerializeField]
private Shader m_imageEffect;
[SerializeField]
private Material m_mat;
private void Awake()
{
if (m_imageEffect != null && m_mat == null)
{
m_mat = new Material(m_imageEffect);
}
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (m_mat != null)
{
Graphics.Blit(source, destination, m_mat);
}
}
}

+ 11
- 0
Assets/Scripts/Effects/ApplyImageEffect.cs.meta View File

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

+ 28
- 0
Assets/Scripts/Float.cs View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Float : MonoBehaviour
{
[SerializeField]
private Vector3 m_direction;
[SerializeField]
private float m_speed;
private Vector3 m_startPosition;
private float m_randomOffset;
// Start is called before the first frame update
void Start()
{
m_startPosition = transform.position;
m_randomOffset = Random.Range(0.0f, 1.0f);
}
// Update is called once per frame
void Update()
{
transform.position = m_startPosition + Mathf.Sin(Time.time * m_speed + m_randomOffset) * m_direction;
}
}

+ 11
- 0
Assets/Scripts/Float.cs.meta View File

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

+ 8
- 0
Assets/Scripts/RenderPass.meta View File

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

+ 8
- 0
Assets/Scripts/Shaders.meta View File

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

+ 54
- 0
Assets/Scripts/Shaders/AlphaMask.shader View File

@ -0,0 +1,54 @@
Shader "Hidden/AlphaMask"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
col.rgb = col.aaa;
col.a = 1;
return col;
}
ENDCG
}
}
}

+ 10
- 0
Assets/Scripts/Shaders/AlphaMask.shader.meta View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 70997f99a8685d34a9333b2aab2df541
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

+ 65
- 0
Assets/Scripts/Shaders/DarknessEffect.shader View File

@ -0,0 +1,65 @@
Shader "ImageEffect/DarknessEffect"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MaskTex ("Texture", 2D) = "white" {}
_BackgroundColor("BackGround Color", Color) = (.25, .5, .5, 1)
_MaskColor("Mask Color", Color) = (1, 1, 1, 1)
_Apply("Darkness Effect Multiplier", Range(0.0, 1.0)) = 0.5
_KeepColors("Show Mask Color", Int) = 1
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
sampler2D _MaskTex;
float4 _BackgroundColor;
float4 _MaskColor;
float _Apply;
float _KeepColors;
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
fixed4 mask = tex2D(_MaskTex, i.uv);
// just invert the colors
col.rgb = lerp(_MaskColor, col, clamp(_KeepColors,0,1));
col.rgb = lerp(_BackgroundColor, col, clamp(mask.r + _Apply, 0, 1));
return col;
}
ENDCG
}
}
}

+ 10
- 0
Assets/Scripts/Shaders/DarknessEffect.shader.meta View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6032c1fdfda8aa14cb05ad0c002b688a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

+ 86
- 0
Assets/Scripts/Shaders/Image.mat View File

@ -0,0 +1,86 @@
%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: Image
m_Shader: {fileID: 4800000, guid: 6032c1fdfda8aa14cb05ad0c002b688a, type: 3}
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}
- _MaskTex:
m_Texture: {fileID: 8400000, guid: 0df5fbf4e7b2d3240bfba78506bbd0b5, type: 2}
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:
- _Apply: 1
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _KeepColors: 1.16
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BackgroundColor: {r: 0.764151, g: 0, b: 0.08963457, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _MaskColor: {r: 0.61624897, g: 1, b: 0, a: 1}
m_BuildTextureStacks: []

Assets/Settings/Renderers/ForwardRenderer.asset.meta → Assets/Scripts/Shaders/Image.mat.meta View File

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

+ 271
- 0
Assets/Settings/PlayerInput.cs View File

@ -0,0 +1,271 @@
// GENERATED AUTOMATICALLY FROM 'Assets/Settings/PlayerInput.inputactions'
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
public class @PlayerInput : IInputActionCollection, IDisposable
{
public InputActionAsset asset { get; }
public @PlayerInput()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""PlayerInput"",
""maps"": [
{
""name"": ""Level"",
""id"": ""2bc60834-e09f-4981-affb-635cad7ffbfd"",
""actions"": [
{
""name"": ""Move"",
""type"": ""Value"",
""id"": ""d1943f36-92e5-4335-a3f3-dd2e9e553ba6"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""Jump"",
""type"": ""Button"",
""id"": ""e7ae7276-c64d-43bb-8719-ef3178e194a0"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
}
],
""bindings"": [
{
""name"": ""WASD"",
""id"": ""a50ea126-50e2-4f31-9167-ac757787a3e6"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""f7f33275-3f13-451c-8219-e1b34d39139c"",
""path"": ""<Keyboard>/w"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""73900688-a28e-40cf-ace2-05ad1b118594"",
""path"": ""<Keyboard>/s"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""c4e7f05b-1733-4e36-b752-6e0cf95f477e"",
""path"": ""<Keyboard>/a"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""f889cf6b-20aa-4169-a5d2-3bdae2e636e3"",
""path"": ""<Keyboard>/d"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""Arrow"",
""id"": ""9328658c-a019-4f76-b35b-5f023f9de6e0"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""16f6fb9d-eb25-445d-9313-fdf19a51b67c"",
""path"": ""<Keyboard>/upArrow"",