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); } }
public void removeKey(Key.KeyType keyType) { if (RedKey) { RedKey.SetActive(false); } if (BlueKey) { BlueKey.SetActive(false); } if (GreenKey) { GreenKey.SetActive(false); } //Debug.Log("Key Removed: " + keyType); keyList.Remove(keyType); }
public void addKey(Key.KeyType keyType) { FindObjectOfType <SoundManager>().PlaySound("KeyPickup"); if (keyType == Key.KeyType.Red) { RedKey.SetActive(true); } if (keyType == Key.KeyType.Blue) { BlueKey.SetActive(true); } if (keyType == Key.KeyType.Green) { GreenKey.SetActive(true); } //Debug.Log("Key Added: " + keyType); keyList.Add(keyType); }
void Awake() { YellowKey.SetActive(false); BlueKey.SetActive(false); RedKey.SetActive(false); }