Пример #1
0
 private void Awake()
 {
     if (!DoorToUnlock)
     {
         DoorToUnlock = gameObject.GetComponent <MultiDoor>();
     }
 }
Пример #2
0
 private void Awake()
 {
     if (GetComponentInParent <MultiDoor>())
     {
         MultiDoorController = GetComponentInParent <MultiDoor>();
     }
 }
Пример #3
0
 private void Awake()
 {
     if (!MultiDoorComponent)
     {
         MultiDoorComponent = GetComponent <MultiDoor>();
     }
 }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     foreach (Interactable i in gameObject.GetComponents <Interactable>())
     {
         Interactables.Add(i);
     }
     //Grabs the Parent door - handling very specific case for James/
     JamesDoor = CommodityChecker.gameObject.GetComponent <MultiDoor>();
 }
Пример #5
0
 private void Awake()
 {
     if (TargetDoor = GetComponent <MultiDoor>())
     {
         print("Multi door found for audio ");
     }
     else
     {
         this.enabled = false;
     }
     if (DoorAudioSource = GetComponent <AudioSource>())
     {
         print("Source found for Dooraudio ");
         DoorAudioSource.spatialize   = true;
         DoorAudioSource.spatialBlend = 1.0f;
         //Bind events to MultiDoor
         TargetDoor.DoorOpeningEvent.AddListener(PlayOpenSound);
         TargetDoor.DoorClosingEvent.AddListener(PlayCloseSound);
         TargetDoor.DoorLockedEvent.AddListener(PlayLockedSound);
         TargetDoor.DoorUnlockedEvent.AddListener(PlayUnlockedSound);
     }
 }