private void Awake() { if (!DoorToUnlock) { DoorToUnlock = gameObject.GetComponent <MultiDoor>(); } }
private void Awake() { if (GetComponentInParent <MultiDoor>()) { MultiDoorController = GetComponentInParent <MultiDoor>(); } }
private void Awake() { if (!MultiDoorComponent) { MultiDoorComponent = GetComponent <MultiDoor>(); } }
// 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>(); }
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); } }