public override void LookFunction() { if (count > scriptEndTimeLook && !isBroken) { if (target.GetComponent <SlidingDoor>() != null) { target.GetComponent <SlidingDoor>().force_activation_state(false); } else { target.isActivating = false; } broken = true; AkSoundEngine.PostEvent(stopChargingSound, gameObject); AkSoundEngine.PostEvent(breakSound, gameObject); AkSoundEngine.PostEvent(dogDeathSound, target.gameObject); blinkingLight.Break(); Break(); scriptEndElevator.Activate(); StartCoroutine(DogDeathCoroutine()); } else { base.LookFunction(); } }
void GetPressed() { if (b1BoxCollider.IsTouchingLayers(LayerMask.GetMask("Player")) && b2BoxCollider.IsTouchingLayers(LayerMask.GetMask("Player"))) { if (!b1BoxCollider.isTrigger && !b2BoxCollider.isTrigger) { if (forGate) { gateScript.Activate(); } if (forBridge) { bridgeScript.Activate(); } if (forElevator) { elevatorScript.Activate(); } if (for2Elevators) { elevatorScript.Activate(); elevator2Script.Activate(); } if (forFire) { IEnumerator WaitToKillFire() { yield return(new WaitForSeconds(1f)); Destroy(fire); } StartCoroutine(WaitToKillFire()); } } b1BoxCollider.isTrigger = true; b1CapsuleCollider.isTrigger = true; b2BoxCollider.isTrigger = true; b2CapsuleCollider.isTrigger = true; } }
// Update is called once per frame void Update() { if (m_isPlayerInBounds) { if (Input.GetButtonUp("Use")) { Debug.Log("Update() activating elevator"); m_elevator.Activate(); } } }
private void PowerOn() { energyOn = true; elevator.Activate(); foreach (GameObject go in lights) { go.SetActive(true); } HideInteraction(); StartCoroutine(WaitToNextBlackout()); powerAudioSource.PlayOneShot(powerOnClip); }
private void Update() { if (InputSplitter.GetInteractPressed(fpsMove.PlayerID)) { RaycastHit hitInfo; if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out hitInfo, InteractDistance, interactLayer)) { if (hitInfo.collider.gameObject.layer == airconLayer) { GameObject hitObj = hitInfo.transform.parent.gameObject; Aircon airconController = hitObj.GetComponent <Aircon>(); if (airconController) { airconController.Activate(); } } else if (hitInfo.collider.gameObject.layer == doorLayer) { GameObject hitObj = hitInfo.transform.parent.parent.gameObject; Door doorController = hitObj.GetComponent <Door>(); if (doorController) { doorController.Activate(); } } else if (hitInfo.collider.gameObject.layer == elevatorActivateLayer) { GameObject hitObj = hitInfo.transform.parent.gameObject; Elevator elevatorController = hitObj.GetComponent <Elevator>(); if (elevatorController) { elevatorController.Activate(); } } else if (hitInfo.collider.gameObject.layer == elevatorSlowActivateLayer) { Elevator elevatorController = elevatorTerminal.GetComponent <Elevator>(); if (elevatorController) { elevatorController.ActivateSlow(); } } } } if (InputSplitter.GetSmokePressed(fpsMove.PlayerID)) { smokeBombController.Activate(); } }
void GetPressed() { if (myCapsuleCollider.IsTouchingLayers(LayerMask.GetMask("Player"))) { if (active) { if (forGate) { gateScript.Activate(); } if (forBridge) { bridgeScript.Activate(); } if (forElevator) { elevatorScript.Activate(); } if (forWaterfall) { waterfallScript.StopWaterfall(); } if (forFire) { IEnumerator WaitToKillFire() { yield return(new WaitForSeconds(1f)); Destroy(fire); } StartCoroutine(WaitToKillFire()); } } active = false; } }