public void RestoreCheckpoint() { animator.SetBool("dead", false); if (GameManager.instance.bossFightReady) { LastArtifact lastArtifact = GameManager.instance.lastArtifact; myTransform.position = new Vector3( lastArtifact.defaultPosition.x, lastArtifact.defaultPosition.y, myTransform.position.z); deathHandler.alive = true; return; } int checkpoint = GameManager.instance.currentCheckpoint; Artifact artifact = GameManager.instance.GetArtifact(checkpoint); if (artifact == null) { myTransform.position = defaultPosition; } else { myTransform.position = new Vector3( artifact.defaultPosition.x, artifact.defaultPosition.y, myTransform.position.z); } deathHandler.alive = true; }
private void Start() { boss = FindObjectOfType <Boss>(); ghosts = FindObjectsOfType <Ghost>(); lesserArtifacts = FindObjectsOfType <LesserArtifact>(); lastArtifact = FindObjectOfType <LastArtifact>(); for (int i = 0; i < ghosts.Length; i++) { ghosts[i].gameObject.SetActive(false); ghosts[i].defaultPosition = ghosts[i].transform.position; } artifacts = FindObjectsOfType <Artifact>(); Color c = fadePanel.color; fadePanel.color = new Color(c.r, c.g, c.b, 0f); totalLesserArtifacts = FindObjectsOfType <LesserArtifact>().Length; UpdateGUI(); pauseCanvas.gameObject.SetActive(false); }