@ -0,0 +1,8 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 4fcfd2d70cff21d4ba923565a0fc6c61 | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
size 1758 |
@ -0,0 +1,156 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 8a23e75d544e7154ca3b6e33c7feaff3 | |||||
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: 1 | |||||
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: 100 | |||||
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: |
size 1726 |
@ -0,0 +1,156 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 3b602cd9815cf5342b732566bbeefbb8 | |||||
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: 1 | |||||
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: 100 | |||||
spriteBorder: {x: 1, y: 1, z: 1, w: 1} | |||||
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: |
size 1029 | size 1029 |
size 39413 |
size 72660 |
@ -0,0 +1,7 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 8d22d24360cdbac4e9cfef8f8dbec2a9 | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
size 46191 |
size 1966230 |
size 594145 |
size 388608 |
@ -1,124 +1,123 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
using UnityEngine.InputSystem; | |||||
using Variables; | |||||
using NaughtyAttributes; | |||||
public class CharacterInputController : MonoBehaviour | |||||
{ | |||||
[SerializeField, Header("References")] | |||||
private CharacterController2D m_characterController; | |||||
[SerializeField] | |||||
private Reference<bool> m_playerInput; | |||||
[SerializeField] | |||||
private Reference<bool> m_noInputAllowed; | |||||
[SerializeField] | |||||
private Reference<bool> m_isPlayerDead; | |||||
[SerializeField] | |||||
private Reference<bool> m_isVictory; | |||||
[SerializeField] | |||||
private Animator m_animator; | |||||
[SerializeField] | |||||
private AudioClip m_DeathSound; | |||||
[SerializeField] | |||||
private AudioClip m_VictoryClip; | |||||
[SerializeField] | |||||
private AudioClip m_JumpSound; | |||||
[SerializeField, BoxGroup("Settings")] | |||||
private float m_speed = 2.0f; | |||||
[ShowNonSerializedField] | |||||
private Vector2 m_movement; | |||||
[ShowNonSerializedField] | |||||
private bool m_jump; | |||||
private void OnEnable() | |||||
{ | |||||
m_isPlayerDead.OnValueChanged += OnDeath; | |||||
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>(); | |||||
} | |||||
public void OnJump(InputAction.CallbackContext context) | |||||
{ | |||||
m_jump = context.ReadValueAsButton(); | |||||
} | |||||
private void Update() | |||||
{ | |||||
if (!m_noInputAllowed) | |||||
{ | |||||
m_characterController.Move(m_movement.x * m_speed, false, m_jump); | |||||
m_playerInput.Value = m_movement.magnitude != 0 || m_jump; | |||||
} | |||||
else | |||||
{ | |||||
m_characterController.Move(0, false, false); | |||||
m_playerInput.Value = false; | |||||
} | |||||
m_animator.SetBool("isMoving", m_playerInput); | |||||
} | |||||
public void OnLandHappened() | |||||
{ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
using UnityEngine.InputSystem; | |||||
using Variables; | |||||
using NaughtyAttributes; | |||||
public class CharacterInputController : MonoBehaviour | |||||
{ | |||||
[SerializeField, Header("References")] | |||||
private CharacterController2D m_characterController; | |||||
[SerializeField] | |||||
private Reference<bool> m_playerInput; | |||||
[SerializeField] | |||||
private Reference<bool> m_noInputAllowed; | |||||
[SerializeField] | |||||
private Reference<bool> m_isPlayerDead; | |||||
[SerializeField] | |||||
private Reference<bool> m_isVictory; | |||||
[SerializeField] | |||||
private Animator m_animator; | |||||
[SerializeField] | |||||
private AudioClip m_DeathSound; | |||||
[SerializeField] | |||||
private AudioClip m_VictoryClip; | |||||
[SerializeField] | |||||
private AudioClip m_JumpSound; | |||||
[SerializeField, BoxGroup("Settings")] | |||||
private float m_speed = 2.0f; | |||||
[ShowNonSerializedField] | |||||
private Vector2 m_movement; | |||||
[ShowNonSerializedField] | |||||
private bool m_jump; | |||||
private void OnEnable() | |||||
{ | |||||
m_isPlayerDead.OnValueChanged += OnDeath; | |||||
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>(); | |||||
} | |||||
public void OnJump(InputAction.CallbackContext context) | |||||
{ | |||||
m_jump = context.ReadValueAsButton(); | |||||
} | |||||
private void Update() | |||||
{ | |||||
if (!m_noInputAllowed) | |||||
{ | |||||
m_characterController.Move(m_movement.x * m_speed, false, m_jump); | |||||
m_playerInput.Value = m_movement.magnitude != 0 || m_jump; | |||||
} | |||||
else | |||||
{ | |||||
m_characterController.Move(0, false, false); | |||||
m_playerInput.Value = false; | |||||
} | |||||
m_animator.SetBool("isMoving", m_playerInput); | |||||
} | |||||
public void OnLandHappened() | |||||
{ | |||||
m_animator.SetTrigger("Land"); | |||||
} | |||||
public void OnJumpHappened() | |||||
{ | |||||
m_animator.SetTrigger("Land"); | m_animator.SetTrigger("Land"); | ||||
} | |||||
public void OnJumpHappened() | |||||
{ | |||||
m_animator.SetTrigger("Land"); | |||||
//AudioSource.PlayClipAtPoint(m_JumpSound, transform.position); | |||||
} | |||||
public void OnDeath(bool value) | |||||
{ | |||||
//AudioSource.PlayClipAtPoint(m_JumpSound, transform.position); | |||||
} | |||||
public void OnDeath(bool value) | |||||
{ | |||||
if (value) | if (value) | ||||
{ | { | ||||
m_animator.SetTrigger("Death"); | |||||
AudioSource.PlayClipAtPoint(m_DeathSound, transform.position); | |||||
} | |||||
else | |||||
m_animator.SetTrigger("Respawn"); | |||||
} | |||||
public void OnVictory(bool value) | |||||
{ | |||||
m_animator.SetTrigger("Death"); | |||||
AudioSource.PlayClipAtPoint(m_DeathSound, transform.position); | |||||
} | |||||
else | |||||
m_animator.SetTrigger("Respawn"); | |||||
} | |||||
public void OnVictory(bool value) | |||||
{ | |||||
if (value) | if (value) | ||||
{ | { | ||||
m_animator.SetTrigger("Victory"); | |||||
AudioSource.PlayClipAtPoint(m_VictoryClip, transform.position); | |||||
} | |||||
} | |||||
} | |||||
m_animator.SetTrigger("Victory"); | |||||
AudioSource.PlayClipAtPoint(m_VictoryClip, transform.position); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,77 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
using UnityEngine.SceneManagement; | |||||
using UnityEngine.UI; | |||||
using TMPro; | |||||
public class HowToPlayController : MonoBehaviour | |||||
{ | |||||
[SerializeField] | |||||
private MaskableGraphic[] graphics; | |||||
[SerializeField] | |||||
private float fadeTime = 1.0f; | |||||
[SerializeField] | |||||
private float showTime = 3; | |||||
[SerializeField] | |||||
private string NextLevel = "Level 1"; | |||||
IEnumerator Start() | |||||
{ | |||||
float elapsedTime = 0; | |||||
Color color; | |||||
while (elapsedTime < fadeTime) | |||||
{ | |||||
foreach(MaskableGraphic g in graphics) | |||||
{ | |||||
color = g.color; | |||||
color.a = elapsedTime / fadeTime; | |||||
g.color = color; | |||||
yield return new WaitForEndOfFrame(); | |||||
elapsedTime += Time.deltaTime; | |||||
} | |||||
} | |||||
foreach (MaskableGraphic g in graphics) | |||||
{ | |||||
color = g.color; | |||||
color.a = 1; | |||||
g.color = color; | |||||
} | |||||
yield return new WaitForSeconds(showTime); | |||||
elapsedTime = 0; | |||||
while (elapsedTime < fadeTime) | |||||
{ | |||||
foreach (MaskableGraphic g in graphics) | |||||
{ | |||||
color = g.color; | |||||
color.a = 1 - elapsedTime / fadeTime; | |||||
g.color = color; | |||||
yield return new WaitForEndOfFrame(); | |||||
elapsedTime += Time.deltaTime; | |||||
} | |||||
} | |||||
foreach (MaskableGraphic g in graphics) | |||||
{ | |||||
color = g.color; | |||||
color.a = 0; | |||||
g.color = color; | |||||
} | |||||
SceneManager.LoadScene(NextLevel); | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 3a01dc30c0a986a4cba3649c4aedf9db | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
size 968 |
size 20001 |