2024-02-27 19:03:50 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
// when Unlock() is called, sets locked to false for all attached Lockables
|
|
|
|
|
|
|
|
public class Unlocker : MonoBehaviour
|
|
|
|
{
|
|
|
|
public List<Lockable> attachedLockables = new List<Lockable>();
|
2024-02-29 18:29:22 +01:00
|
|
|
public AudioSource unlockSound;
|
2024-02-27 19:03:50 +01:00
|
|
|
public void Unlock(){
|
|
|
|
foreach(Lockable lockable in attachedLockables){
|
|
|
|
lockable.locked = false;
|
|
|
|
}
|
2024-02-29 18:29:22 +01:00
|
|
|
unlockSound.Play();
|
2024-02-27 19:03:50 +01:00
|
|
|
}
|
|
|
|
}
|