Beispiel #1
0
 void FixedUpdate()
 {
     if (GameStart)
     {
         Vector3    fwd = transform.TransformDirection(Vector3.forward);
         RaycastHit Hit;
         if (Physics.Raycast(transform.position, -fwd, out Hit))
         {
             foreach (GameObject Tick in LockTicks)
             {
                 if (Hit.collider.gameObject == Tick)
                 {
                     if ((Tick == LockTicks [LockCombo [CurrentLock]]))
                     {
                         Tick.GetComponent <LockTick> ().Unlock = true;
                         Lights [CurrentLock].GetComponent <Renderer> ().material = Green;
                         if (CurrentLock != LockCombo.Length - 1)
                         {
                             CurrentLock++;
                         }
                         else
                         {
                             GameStart      = false;
                             CountDown.text = "You've unlocked the safe!";
                         }
                     }
                     if (CurrentLock > 0)
                     {
                         ;
                     }
                     Tick.GetComponent <LockTick> ().MoveUp = true;
                 }
                 else
                 {
                     Tick.GetComponent <LockTick> ().MoveUp = false;
                 }
             }
         }
     }
 }