Beispiel #1
0
    void Update()
    {
        introText.text = "Level " + guiDisplay.GetLevel().ToString();
        Color newColor   = introText.material.color;
        float proportion = Time.timeSinceLevelLoad / duration;

        newColor.a = Mathf.Lerp(1, 0, proportion);
        introText.material.color = newColor;
    }
Beispiel #2
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Door" && isCarryingKey == true)
     {
         int lvl = guiDisplay.GetLevel();
         if (lvl == 1)
         {
             Door.GetComponent <Animation>().Play("DoorAnim");
         }
         else if (lvl == 2)
         {
             Door.GetComponent <Animation>().Play("DoorAnim2");
         }
     }
 }