mirror of
https://github.com/Kizuren/SynthMaze.git
synced 2026-01-11 17:11:23 +01:00
32 lines
747 B
C#
32 lines
747 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MultipleLevel : MonoBehaviour
|
|
{
|
|
public Animator animator;
|
|
|
|
void Awake()
|
|
{
|
|
GetComponent<Collider2D>().isTrigger = true;
|
|
animator.SetBool("nextLevel", false);
|
|
}
|
|
|
|
void OnTriggerEnter2D(Collider2D c2d)
|
|
{
|
|
// Stage 2: If all coins are collected, then check if the player collides with the LevelMgr, then the Player cant move and its invisible
|
|
if (c2d.CompareTag("Player") && LevelMgr.steps == 1)
|
|
{
|
|
LevelMgr.MultipleTriggered = true;
|
|
|
|
}
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if(LevelMgr.steps == 1)
|
|
{
|
|
animator.SetBool("nextLevel", true);
|
|
}
|
|
}
|
|
}
|