// Update is called once per frame void Update() { if (emergencyLights.GetLightState() == LightsState.Emergency) { corridorLight.color = Color.red; corridorLight.enabled = true; } if (emergencyLights.GetLightState() == LightsState.Normal) { corridorLight.color = Color.white; corridorLight.enabled = true; } }
// Update is called once per frame void Update() { if (emergencyLights.GetLightState() != LightsState.Off) { ChangeDoorState(); } }
private void RayToDoor() { Ray ray = new Ray(playerView.transform.position, playerView.transform.forward); RaycastHit hit; if (Physics.Raycast(ray, out hit, MAXDISTANCEOFRAY)) { if (Input.GetKeyDown(leftMouseKeyDown)) { if (hit.collider.gameObject.layer == LayerMask.NameToLayer("Buttons")) { currentButtonState = hit.collider.gameObject.GetComponent <ButtonClicked>(); currentDoorTransform = hit.collider.gameObject.GetComponentInParent <DoorIsOpenedAndClosed>(); doorOpenCloseSound = hit.collider.gameObject.GetComponentInParent <DoorOpenColseSound>(); currentButtonState.ButtonClick(); doorOpenCloseSound.PlayClip(); if (emergencyLights.GetLightState() != LightsState.Off) { currentDoorTransform.SetDoorIsOpened(); } } } } }
void Update() { if (emergencyLights.GetLightState() != LightsState.Off) { doorOpenSound = Resources.Load("GameSounds/DoorSounds/openDoor", typeof(AudioClip)) as AudioClip; doorCloseSound = Resources.Load("GameSounds/DoorSounds/openDoor", typeof(AudioClip)) as AudioClip; } }
public void NormalModeActivate() { if (emergencyLights.GetLightState() == LightsState.Emergency) { switchAcitve.PlayPowerOnSound(); } emergencyLights.SetLightState(LightsState.Normal); }