public void RespawnPlayer() { isRespawning = true; playerData = SaveSystem.LoadPlayer(); player.transform.position = new Vector3(playerData.playerPosition[0], playerData.playerPosition[1], playerData.playerPosition[2]); player.SetActive(true); playerStats.UpdateHealth(playerData.playerHealth); playerStats.GetKey("Yellow Key", playerData.yellowKey); playerStats.GetKey("Blue Key", playerData.blueKey); playerStats.GetKey("Red Key", playerData.redKey); if (!playerData.yellowKey && !YellowKey.activeSelf) { YellowKey.SetActive(true); YellowKey.GetComponent <Animator> ().SetBool("Taken", false); } if (!playerData.blueKey && !BlueKey.activeSelf) { BlueKey.SetActive(true); BlueKey.GetComponent <Animator> ().SetBool("Taken", false); } if (!playerData.redKey && !RedKey.activeSelf) { RedKey.SetActive(true); RedKey.GetComponent <Animator> ().SetBool("Taken", false); } }
public void DisableKey(string keyColor) { if (keyColor == "Yellow Key") { YellowKey.SetActive(false); } else if (keyColor == "Blue Key") { BlueKey.SetActive(false); } else if (keyColor == "Red Key") { RedKey.SetActive(false); } }
void Awake() { YellowKey.SetActive(false); BlueKey.SetActive(false); RedKey.SetActive(false); }