Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 void Awake()
 {
     YellowKey.SetActive(false);
     BlueKey.SetActive(false);
     RedKey.SetActive(false);
 }