Commit 26f2bfe5 authored by Jan Meissner's avatar Jan Meissner
Browse files

Merge remote-tracking branch 'origin/master'

parents 0aa11835 23c8d563
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BodyParts
m_Shader: {fileID: 203, 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.5
- _GlossyReflections: 1
- _InvFade: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
fileFormatVersion: 2
guid: 7302d929ac7a2f44180b44e09592ac8a
folderAsset: yes
DefaultImporter:
guid: c4fc0d9c88e2d91469ee107a729ea1af
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
......@@ -217,11 +217,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 4383029025640084, guid: 643858c7b38da3e42aec11e5bd268411, type: 2}
propertyPath: m_LocalRotation.z
value: 1
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4383029025640084, guid: 643858c7b38da3e42aec11e5bd268411, type: 2}
propertyPath: m_LocalRotation.w
value: 0
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 4383029025640084, guid: 643858c7b38da3e42aec11e5bd268411, type: 2}
propertyPath: m_RootOrder
......@@ -234,12 +234,12 @@ Prefab:
objectReference: {fileID: 703386524}
- target: {fileID: 4383029025640084, guid: 643858c7b38da3e42aec11e5bd268411, type: 2}
propertyPath: m_LocalEulerAnglesHint.z
value: 180
value: -90
objectReference: {fileID: 0}
- target: {fileID: 114953758882948998, guid: 643858c7b38da3e42aec11e5bd268411,
type: 2}
propertyPath: orientation
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114953758882948998, guid: 643858c7b38da3e42aec11e5bd268411,
type: 2}
......
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 7d76a63dfd317814d9eef925c0df39c7
folderAsset: yes
guid: 9371fda64737d4442b4097fec4a95911
DefaultImporter:
externalObjects: {}
userData:
......
......@@ -23,11 +23,6 @@ public class InteractibleLever : MonoBehaviour, IInteractible, IResetable {
ResetToLevelBegin();
}
private void Start() {
onInteract.Invoke(state);
onInteractInversed.Invoke(!state);
}
public void Interact(PlayerActor source) {
if (source.Orientation == orientation) {
state = !state;
......@@ -45,6 +40,6 @@ public class InteractibleLever : MonoBehaviour, IInteractible, IResetable {
public void ResetToLevelBegin() {
state = isActive;
UpdateSprite();
onInteract.Invoke(isActive);
}
}
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;
public class LaserController : MonoBehaviour {
......@@ -23,4 +24,13 @@ public class LaserController : MonoBehaviour {
c.enabled = value;
}
}
[Button]
public void ToggleState() {
if (laserRenderer[0] == null) return;
bool state = laserRenderer[0].enabled;
SetState(!state);
}
}
......@@ -45,6 +45,10 @@ public class PlayerActor : MonoBehaviour, IResetable {
[SerializeField] private Animator animator;
[SerializeField] private ParticleSystem deathEffect;
[SerializeField] private SpriteRenderer sprite;
[SerializeField] private float peekingDistance;
private readonly Collider2D[] contactBuffer = new Collider2D[64];
......@@ -93,7 +97,7 @@ public class PlayerActor : MonoBehaviour, IResetable {
private void OnTriggerEnter2D(Collider2D other) {
// Collides with Hazard
if (other.gameObject.layer == 11) {
Die();
StartCoroutine(Die());
}
}
......@@ -396,7 +400,13 @@ public class PlayerActor : MonoBehaviour, IResetable {
UpdateOrientation();
}
private static void Die() {
private IEnumerator Die() {
deathEffect.Play(true);
col.enabled = false;
sprite.enabled = false;
yield return new WaitForSeconds(0.1f);
// TODO: This call is really inefficient
IResetable[] resetables = FindObjectsOfType<MonoBehaviour>().OfType<IResetable>().ToArray();
foreach (IResetable r in resetables) {
......@@ -410,15 +420,18 @@ public class PlayerActor : MonoBehaviour, IResetable {
movementRoutine = null;
}
transform.position = startingPosition;
orientation = startingOrientation;
sprite.enabled = true;
col.enabled = true;
animator.SetBool("isFalling", false);
animator.SetBool("isRunning", false);
animator.SetBool("isPeeking", false);
animator.SetBool("shouldSlide", false);
animator.Play("Idle");
transform.position = startingPosition;
orientation = startingOrientation;
UpdateOrientation();
}
}
......@@ -38,6 +38,7 @@ public class TimedToggle : MonoBehaviour, IResetable {
public void ResetToLevelBegin() {
state = isActive;
time = 0;
onStateChange.Invoke(isActive);
}
}
fileFormatVersion: 2
guid: 8bf6d380d1a5e664ea2336072d30002a
TextureImporter:
fileIDToRecycleName:
21300000: Bodyparts_0
21300002: Bodyparts_1
21300004: Bodyparts_2
21300006: Bodyparts_3
21300008: Bodyparts_4
21300010: Bodyparts_5
21300012: Bodyparts_6
21300014: Bodyparts_7
21300016: Bodyparts_8
21300018: Bodyparts_9
21300020: Bodyparts_10
21300022: Bodyparts_11
21300024: Bodyparts_12
21300026: Bodyparts_13
21300028: Bodyparts_14
externalObjects: {}
serializedVersion: 7
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 64
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Bodyparts_0
rect:
serializedVersion: 2
x: 2
y: 847
width: 62
height: 49
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: -24, y: 24.5}
- {x: -31, y: 13.5}
- {x: -31, y: -24.5}
- {x: -7, y: -24.5}
- {x: 31, y: 10.5}
- {x: 31, y: 24.5}
physicsShape:
- - {x: -27, y: 24.5}
- {x: -31, y: 9.5}
- {x: -31, y: -24.5}
- {x: -8, y: -24.5}
- {x: 31, y: 14.5}
- {x: 31, y: 24.5}
tessellationDetail: 0
bones: []
spriteID: 7c7260f263eae48489160acea7a2af27
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_1
rect:
serializedVersion: 2
x: 8
y: 776
width: 47
height: 61
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 1.5, y: 30.5}
- {x: -19.5, y: 1.5}
- {x: -23.5, y: -30.5}
- {x: -6.5, y: -30.5}
- {x: 23.5, y: 21.5}
- {x: 23.5, y: 29.5}
- {x: 21.5, y: 30.5}
physicsShape:
- - {x: 1.5, y: 30.5}
- {x: -18.5, y: 1.5}
- {x: -23.5, y: -15.5}
- {x: -23.5, y: -29.5}
- {x: -21.5, y: -30.5}
- {x: -5.5, y: -30.5}
- {x: 23.5, y: 22.5}
- {x: 23.5, y: 29.5}
- {x: 19.5, y: 30.5}
tessellationDetail: 0
bones: []
spriteID: 27eaff0fc798b6748bb237e08506843a
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_2
rect:
serializedVersion: 2
x: 8
y: 711
width: 51
height: 64
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 23.5, y: 32}
- {x: -25.5, y: 32}
- {x: -25.5, y: -17}
- {x: -6.5, y: -32}
- {x: 4.5, y: -32}
- {x: 24.5, y: -6}
- {x: 25.5, y: 1}
- {x: 25.5, y: 31}
physicsShape:
- - {x: -20.5, y: 32}
- {x: -25.5, y: 31}
- {x: -25.5, y: -16}
- {x: -9.5, y: -31}
- {x: 7.5, y: -31}
- {x: 25.5, y: -6}
- {x: 25.5, y: 30}
- {x: 21.5, y: 32}
tessellationDetail: 0
bones: []
spriteID: 952bf995e44612a4eb7b1831eb7bfd36
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_3
rect:
serializedVersion: 2
x: 2
y: 650
width: 61
height: 54
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 20.5, y: 27}
- {x: 1.5, y: 27}
- {x: -27.5, y: -6}
- {x: -30.5, y: -24}
- {x: -26.5, y: -27}
- {x: 4.5, y: -27}
- {x: 30.5, y: -5}
- {x: 30.5, y: 16}
- {x: 26.5, y: 20}
physicsShape:
- - {x: -4.5, y: 27}
- {x: -30.5, y: -4}
- {x: -30.5, y: -26}
- {x: -29.5, y: -27}
- {x: 9.5, y: -27}
- {x: 30.5, y: -6}
- {x: 30.5, y: 27}
tessellationDetail: 0
bones: []
spriteID: 2f43eb31ef4357d4a8507bb7f10e9dc7
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_4
rect:
serializedVersion: 2
x: 5
y: 582
width: 55
height: 56
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: -13.5, y: 28}
- {x: -20.5, y: 27}
- {x: -27.5, y: 21}
- {x: -27.5, y: -28}
- {x: 13.5, y: -28}
- {x: 27.5, y: -22}
- {x: 27.5, y: 21}
- {x: 21.5, y: 28}
- - {x: 10.5, y: 18}
- {x: 9.5, y: 18}
- {x: 7.5, y: 15}
physicsShape:
- - {x: 20.5, y: -7}
- {x: 24.5, y: -2}
- {x: 27.5, y: 10}
- {x: 27.5, y: 16}
- {x: 22.5, y: 23}
- {x: 17.5, y: 24}
- {x: 11.5, y: 18}
- {x: 14.5, y: 25}
- {x: 15.5, y: 28}
- {x: -21.5, y: 28}
- {x: -27.5, y: 16}
- {x: -27.5, y: -25}
- {x: -21.5, y: -28}
- {x: 5.5, y: -28}
- {x: 22.5, y: -21}
- {x: 27.5, y: -17}
- {x: 27.5, y: -4}
- {x: 22.5, y: -5}
tessellationDetail: 0
bones: []
spriteID: 76ed6289decbceb44a47bac30083bed2
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_5
rect:
serializedVersion: 2
x: 0
y: 517
width: 63
height: 63
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: -31.5, y: 31.5}
- {x: -31.5, y: -31.5}
- {x: 1.5, y: -31.5}
- {x: 31.5, y: -6.5}
- {x: 31.5, y: 28.5}
- {x: 30.5, y: 31.5}
physicsShape:
- - {x: -30.5, y: 31.5}
- {x: -30.5, y: -31.5}
- {x: -2.5, y: -31.5}
- {x: 31.5, y: 1.5}
- {x: 31.5, y: 21.5}
- {x: 14.5, y: 31.5}
tessellationDetail: 0
bones: []
spriteID: 396a4b83122d993499279946ee8f520e
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_6
rect:
serializedVersion: 2
x: 4
y: 451
width: 60
height: 62
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 30, y: -25}
- {x: 30, y: 31}
- {x: -26, y: 31}
- {x: -30, y: 22}
- {x: -30, y: -31}
- {x: -8, y: -31}
- {x: 4, y: -31}
- {x: 25, y: -31}
physicsShape:
- - {x: 29, y: 9}
- {x: 18, y: 31}
- {x: -19, y: 31}
- {x: -30, y: 24}
- {x: -30, y: -27}
- {x: -25, y: -31}
- {x: -9, y: -31}
- {x: 30, y: -29}
tessellationDetail: 0
bones: []
spriteID: a4551729bb451e84e825555ec481a4d1
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Bodyparts_8
rect:
serializedVersion: 2
x: 4
y: 389
width: 58
height: 59
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: 28, y: 29.5}
- {x: 7, y: 29.5}
- {x: 0, y: 22.5}
- {x: -28, y: -9.5}
- {x: -29, y: -12.5}
- {x: -29, y: -29.5}
- {x: -15, y: -29.5}
- {x: 29, y: 13.5}
- {x: 29, y: 28.5}