Пример #1
0
 private void Start()
 {
     CrystalLight();
     if (bridgeToDeactivate)
     {
         bridgeToDeactivate.StartCoroutine("Activate");
     }
 }
Пример #2
0
 public void Activate()
 {
     if (bridgeToActivate)
     {
         if (!Activated)
         {
             Debug.Log("Activated");
             bridgeToActivate.StartCoroutine("Activate");
             Activated = true;
         }
         else
         {
             bridgeToActivate.StopCoroutine("Activate");
             bridgeToActivate.Start();
             Activated = false;
         }
         GetComponentInChildren <AudioSource>().Play();
         CrystalLight();
     }
     if (bridgeToDeactivate)
     {
         if (!Activated)
         {
             bridgeToDeactivate.StopCoroutine("Activate");
             bridgeToDeactivate.Start();
             if (!bridgeToActivate)
             {
                 Activated = true;
             }
         }
         else
         {
             Debug.Log("DeActivated");
             bridgeToDeactivate.StartCoroutine("Activate");
             if (!bridgeToActivate)
             {
                 Activated = false;
             }
         }
     }
 }