Commit cd09c4ea authored by Markus Schlösser's avatar Markus Schlösser
Browse files

Updated level 17 - 19

parent f1f27864
......@@ -325,6 +325,7 @@ MonoBehaviour:
animator: {fileID: 95392249558912674}
deathEffect: {fileID: 198871341561184788}
sprite: {fileID: 212359673814677190}
headlight: {fileID: 1331226396172540}
peekingDistance: 7
--- !u!198 &198578123707514436
ParticleSystem:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -25,9 +25,7 @@ public class InLevelController : MonoBehaviour {
private IEnumerator LevelEndRoutine() {
PlayerActor player = FindObjectOfType<PlayerActor>();
Animator anim = player.GetComponent<Animator>();
anim.Play("LevelEnd");
player.GetComponent<Collider2D>().enabled = false;
player.enabled = false;
player.LevelEnd();
yield return new WaitForSeconds(anim.GetCurrentAnimatorStateInfo(0).length);
......
......@@ -50,6 +50,8 @@ public class PlayerActor : MonoBehaviour, IResetable {
[SerializeField] private SpriteRenderer sprite;
[SerializeField] private GameObject headlight;
[SerializeField] private float peekingDistance;
private readonly Collider2D[] contactBuffer = new Collider2D[64];
......@@ -406,6 +408,7 @@ public class PlayerActor : MonoBehaviour, IResetable {
deathEffect.Play(true);
col.enabled = false;
sprite.enabled = false;
headlight.SetActive(false);
yield return new WaitForSeconds(0.1f);
......@@ -416,6 +419,13 @@ public class PlayerActor : MonoBehaviour, IResetable {
}
}
public void LevelEnd() {
animator.Play("LevelEnd");
enabled = false;
col.enabled = false;
headlight.SetActive(false);
}
public void ResetToLevelBegin() {
if (movementRoutine != null) {
StopCoroutine(movementRoutine);
......@@ -427,6 +437,7 @@ public class PlayerActor : MonoBehaviour, IResetable {
sprite.enabled = true;
col.enabled = true;
headlight.SetActive(true);
animator.SetBool("isFalling", false);
animator.SetBool("isRunning", false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment