Beispiel #1
0
 public virtual void OpenDoor(int KeyValue)
 {
     if (!IsLocked || (IsLocked && KeyValue == keyValue))
     {
         //TODO Make success sound
         AudioSourcePool.PlayAtPoint(doorSounds.KeyInsert, transform.position);
         AudioSourcePool.PlayAtPoint(doorSounds.DoorUnlock, transform.position);
         OpenDoor();
     }
     else
     {
         //TODO Make failure Sound
         AudioSourcePool.PlayAtPoint(doorSounds.DoorLocked, transform.position);
     }
 }
Beispiel #2
0
 public void PickDoor(int lockpickValue)
 {
     updateTimer = 0;
     if (lockpickValues.Length > 0)
     {
         if (tumblerPos == lockpickValues.Length)
         {
             //TODO Make unlock sound
             AudioSourcePool.PlayAtPoint(doorSounds.DoorUnlock, transform.position);
             OpenDoor();
             tumblerPos = 0;
             oldTimer   = lockPicktimer = 0;
         }
         else if (lockpickValue == lockpickValues[tumblerPos])
         {
             lockPicktimer += Time.deltaTime;
             if (lockPicktimer > timeToLockpick)
             {
                 //TODO Make success sound
                 AudioSourcePool.PlayAtPoint(doorSounds.KeyInsert, transform.position);
                 tumblerPos++;
                 lockPicktimer = 0;
             }
             else
             {
                 //TODO Make lockpicking sound
                 AudioSourcePool.PlayAtPoint(doorSounds.LockPicking, transform.position);
             }
         }
         else
         {
             lockPicktimer = 0;
             //TODO Make failure Sound
         }
     }
     else if (!IsLocked)
     {
         OpenDoor();
     }
     else
     {
         //TODO Make failure Sound
         AudioSourcePool.PlayAtPoint(doorSounds.KeyRemove, transform.position);
     }
 }
Beispiel #3
0
    private void Update()
    {
        if (tumblerPos != 0 || (System.Math.Abs(oldTimer) > 0 && System.Math.Abs(oldTimer - lockPicktimer) < 0.01))
        {
            updateTimer += Time.deltaTime;
            if (updateTimer > 1.3f)
            {
                lockPicktimer = 0;
                //TODO Make failure Sound
                AudioSourcePool.PlayAtPoint(doorSounds.KeyRemove, transform.position);
                tumblerPos = 0;
            }
        }
        else
        {
            updateTimer = 0;
        }

        oldTimer = lockPicktimer;
    }
Beispiel #4
0
 public void CloseDoor()
 {
     //TODO Make Close sound
     AudioSourcePool.PlayAtPoint(doorSounds.DoorClose, transform.position);
     AnimateDoors("Open", false);
 }