private void closeDoor() { elevatorDoorComp.Close(); BaseDoorController wd = getDoorsForFloorComponent(CurrentFloor); if (wd == null) { return; } wd.Close(); }
// Use this for initialization void Start() { doorsControllers = new List <BaseDoorController>(); foreach (GameObject door in Doors) { if (door == null) { continue; } BaseDoorController doorController = door.GetComponent <BaseDoorController>(); if (doorController == null) { continue; } doorsControllers.Add(doorController); } }