protected override void Awake() { base.Awake(); if (!slidingPart || !playerBlocker) { Debug.Log("Door cannot find one of sliding part or player blocker!"); } closedPosition = slidingPart.transform.position; openedPosition = closedPosition + slidingPart.transform.right * slidingDistance; myAudio = gameObject.GetComponent <AudioSource>(); if (!myAudio) { myAudio = gameObject.AddComponent <AudioSource>(); } myAudio.loop = false; myAudio.playOnAwake = false; // Ensure the door has a door handle FPEInteractableActivateScript[] childActivates = gameObject.GetComponentsInChildren <FPEInteractableActivateScript>(); for (int a = 0; a < childActivates.Length; a++) { if (childActivates[a].gameObject.name == "DoorHandle") { myDoorHandle = childActivates[a]; break; } } if (!myDoorHandle) { Debug.LogError("FPESimpleDoor:: No child Activate Type object called 'DoorHandle' was found on door '" + gameObject.name + "'. Ensure the door has a handle, otherwise it can't be opened!"); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif } }