Browse Source

Merge branch 'main' of http://git.joshuareason.com/Jam/GGJ_2022 into main

# Conflicts:
#	Assets/Scenes/Official Levels/Level 1.unity
main
Jeff 2 years ago
parent
commit
ba46c55f48
27 changed files with 809 additions and 7 deletions
  1. BIN
      Assets/Art Assets/Sound/SFX/Spikes.m4a
  2. +8
    -0
      Assets/Art Assets/Textures/Chars/Monster Remake.meta
  3. BIN
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 0.png
  4. +156
    -0
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 0.png.meta
  5. BIN
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 1.png
  6. +156
    -0
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 1.png.meta
  7. BIN
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 2.png
  8. +156
    -0
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 2.png.meta
  9. BIN
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 3.png
  10. +156
    -0
      Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 3.png.meta
  11. +2
    -2
      Assets/Prefabs/2D Camera.prefab
  12. BIN
      Assets/Scenes/Level 1_Profiles/PostVolume Profile.asset
  13. BIN
      Assets/Scenes/Official Levels/Level 1.unity
  14. BIN
      Assets/Scenes/Official Levels/Level 4.unity
  15. +7
    -0
      Assets/Scenes/Official Levels/Level 4.unity.meta
  16. +0
    -0
      Assets/Scenes/OldLevel 1.unity
  17. +0
    -0
      Assets/Scenes/OldLevel 1.unity.meta
  18. +0
    -0
      Assets/Scenes/OldLevel 2.unity
  19. +0
    -0
      Assets/Scenes/OldLevel 2.unity.meta
  20. +0
    -0
      Assets/Scenes/OldLevel 3.unity
  21. +0
    -0
      Assets/Scenes/OldLevel 3.unity.meta
  22. +6
    -0
      Assets/Scripts/Character/CharacterInputController.cs
  23. +1
    -1
      Assets/Scripts/LevelManager.cs
  24. +83
    -0
      Assets/Scripts/MonsterController.cs
  25. +11
    -0
      Assets/Scripts/MonsterController.cs.meta
  26. +37
    -0
      Assets/Scripts/MonsterHitbox.cs
  27. +11
    -0
      Assets/Scripts/MonsterHitbox.cs.meta

BIN
Assets/Art Assets/Sound/SFX/Spikes.m4a View File


+ 8
- 0
Assets/Art Assets/Textures/Chars/Monster Remake.meta View File

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

BIN
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 0.png (Stored with Git LFS) View File

size 2557

+ 156
- 0
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 0.png.meta View File

@ -0,0 +1,156 @@
fileFormatVersion: 2
guid: 130f12623017bbf4fb1671a98ef0a6fd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 0
aniso: 2
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
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
- serializedVersion: 3
buildTarget: WebGL
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: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 1.png (Stored with Git LFS) View File

size 2683

+ 156
- 0
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 1.png.meta View File

@ -0,0 +1,156 @@
fileFormatVersion: 2
guid: 2bc2f8ee841e5de4da71e60120431b9a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 0
aniso: 2
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
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
- serializedVersion: 3
buildTarget: WebGL
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: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 2.png (Stored with Git LFS) View File

size 2654

+ 156
- 0
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 2.png.meta View File

@ -0,0 +1,156 @@
fileFormatVersion: 2
guid: a538dfd0f5b55c9449be0623784c16b0
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 0
aniso: 2
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
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
- serializedVersion: 3
buildTarget: WebGL
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: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 3.png (Stored with Git LFS) View File

size 2642

+ 156
- 0
Assets/Art Assets/Textures/Chars/Monster Remake/Monster_Remake 3.png.meta View File

@ -0,0 +1,156 @@
fileFormatVersion: 2
guid: 6d5d89360c13cea4d9fc20087ad6125c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
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: 0
aniso: 2
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
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
- serializedVersion: 3
buildTarget: WebGL
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: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 2
Assets/Prefabs/2D Camera.prefab View File

@ -866,8 +866,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
Player: {fileID: 0}
m_FollowStrength: 3
m_FollowX: 0
m_FollowY: 0
m_FollowX: 1
m_FollowY: 1
m_OffsetX: 0
m_OffsetY: 2
--- !u!114 &515301201

BIN
Assets/Scenes/Level 1_Profiles/PostVolume Profile.asset (Stored with Git LFS) View File

size 3472

BIN
Assets/Scenes/Official Levels/Level 1.unity (Stored with Git LFS) View File

size 174240

BIN
Assets/Scenes/Official Levels/Level 4.unity (Stored with Git LFS) View File

size 110580

+ 7
- 0
Assets/Scenes/Official Levels/Level 4.unity.meta View File

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

Assets/Scenes/Level 1.unity → Assets/Scenes/OldLevel 1.unity View File


Assets/Scenes/Level 1.unity.meta → Assets/Scenes/OldLevel 1.unity.meta View File


Assets/Scenes/Level 2.unity → Assets/Scenes/OldLevel 2.unity View File


Assets/Scenes/Level 2.unity.meta → Assets/Scenes/OldLevel 2.unity.meta View File


Assets/Scenes/Level 3.unity → Assets/Scenes/OldLevel 3.unity View File


Assets/Scenes/Level 3.unity.meta → Assets/Scenes/OldLevel 3.unity.meta View File


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

@ -52,6 +52,12 @@ public class CharacterInputController : MonoBehaviour
m_isVictory.OnValueChanged += OnVictory;
}
private void OnDisable()
{
m_isPlayerDead.OnValueChanged -= OnDeath;
m_isVictory.OnValueChanged -= OnVictory;
}
public void OnMove(InputAction.CallbackContext context)
{
m_movement = context.ReadValue<Vector2>();

+ 1
- 1
Assets/Scripts/LevelManager.cs View File

@ -143,7 +143,7 @@ public class LevelManager : MonoBehaviour
{
color.a = elapsedTime / fadeTime;
m_backGround.color = color;
Debug.Log(color.a);
yield return new WaitForEndOfFrame();
elapsedTime += Time.deltaTime;
}

+ 83
- 0
Assets/Scripts/MonsterController.cs View File

@ -0,0 +1,83 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Variables;
public class MonsterController : MonoBehaviour, IResettable
{
[SerializeField, Header("References")]
Reference<float> m_light;
[SerializeField]
private GameObject[] m_possibleFrames;
[SerializeField]
private Transform m_player;
[SerializeField]
public GameObject m_defaultObject;
private void OnEnable()
{
m_light.OnValueChanged += OnLightChange;
}
private void OnDisable()
{
m_light.OnValueChanged -= OnLightChange;
}
private void Start()
{
foreach (Transform child in transform)
{
if (child.gameObject.activeInHierarchy)
m_defaultObject = child.gameObject;
}
}
private void ChangeRandomMonster()
{
GameObject[] inactiveFrames = m_possibleFrames.Where(p => !p.activeInHierarchy).ToArray();
GameObject nextFrame = inactiveFrames[Random.Range(0, inactiveFrames.Length)];
foreach(Transform child in transform)
{
child.gameObject.SetActive(child.gameObject == nextFrame);
}
}
private void OnLightChange(float value)
{
if (value <= 0)
{
ChangeRandomMonster();
}
}
public void OnLevelLoad()
{
}
public IEnumerator OnResetStart(float time)
{
yield break;
}
public void OnResetEnd()
{
foreach (Transform child in transform)
{
child.gameObject.SetActive(child.gameObject == m_defaultObject);
}
}
}

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

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

+ 37
- 0
Assets/Scripts/MonsterHitbox.cs View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Variables;
public class MonsterHitbox : MonoBehaviour, IResettable
{
[SerializeField]
Variable<bool> m_onPlayerDeath;
public void OnLevelLoad()
{
}
public void OnResetEnd()
{
gameObject.layer = LayerMask.NameToLayer("Default");
}
public IEnumerator OnResetStart(float time)
{
yield break;
}
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log($"Collision with {collision.gameObject.name}");
if (collision.CompareTag("Player"))
{
gameObject.layer = LayerMask.NameToLayer("Always Visible");
m_onPlayerDeath.Value = true;
}
}
}

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

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

Loading…
Cancel
Save