1 using System.Collections;
2 using System.Collections.Generic;
4 using UnityEngine.SceneManagement;
6 public class Reset : MonoBehaviour
8 private CheckpointManager checkpointManager;
10 private CheeseCollection cheeseCollection;
12 public GameObject cheeseCoin;
20 checkpointManager = GameObject.FindGameObjectWithTag("CheckpointManager").GetComponent<CheckpointManager>();
21 abyss = GetComponent<Abyss>();
22 health = GetComponent<Health>();
23 cheeseCollection = GetComponent<CheeseCollection>();
28 transform.position = checkpointManager.lastCheckpointPos;
29 cheeseCollection.cheesecount = checkpointManager.lastCheeseCount;
30 cheeseCollection.countText.text = cheeseCollection.cheesecount.ToString();
31 if (checkpointManager.isCheeseCoinCollected)
33 cheeseCoin.SetActive(false);
35 abyss.fallenDown = false;
36 health.mouseHealth = 5;
41 if(abyss.fallenDown || health.mouseHealth <= 0)