private void OnTriggerEnter(Collider other) { SpatialRoom spatialRoom = other.GetComponent <SpatialRoom>(); if (spatialRoom != null) { currentSpatialRoom = spatialRoom; } }
private void ReachEnd() { isMoving = false; if (addSpatialLine) { spatialRoom.addSpatialLine(addedSpatialLine); } if (removeSpatialLine) { nextSpatialRoom.removeSpatialLine(removedSpatialLine); SpatialRoom save = spatialRoom; spatialRoom = nextSpatialRoom; nextSpatialRoom = save; SpatialLine slSave = addedSpatialLine; addedSpatialLine = removedSpatialLine; removedSpatialLine = slSave; } if (scriptTwoSteps) { startPos = endPos.position; endPos.position = endPosStep2.position; lampAnimator.enabled = false; lamp.enabled = true; isActivated = false; enterCol.enabled = false; isStarted = false; AkSoundEngine.PostEvent(breakSound, gameObject); //StartCoroutine(StopEngineCoroutine()); if (blinkingLight != null) { lampAnimator.enabled = false; lamp.enabled = true; blinkingLight.enabled = true; } scriptTwoSteps = false; } else if (isStarted && isBidirectional) { Vector3 save = startPos; startPos = endPos.position; endPos.position = save; isActivated = false; direction *= -1; } }
private void OnTriggerEnter(Collider other) { CameraBlock cameraBlock = other.GetComponent <CameraBlock>(); if (cameraBlock != null) { if (cameraBlock == currentCameraBlock) { return; } if (currentCameraBlock != null) { StartCoroutine(CameraBlockChangesCoroutine()); } currentCameraBlock = cameraBlock; CameraBlockChanges(); return; } SpatialSas spatialSas = other.GetComponent <SpatialSas>(); if (spatialSas != null) { currentSpatialSas = spatialSas; currentSpatialLine = spatialSas.spatialLine; isChangingSpatialLine = true; changingLineDirection = 1; return; } SpatialRoom spatialRoom = other.GetComponent <SpatialRoom>(); if (spatialRoom != null) { currentSpatialRoom = spatialRoom; if (currentSpatialSas == null) { chooseNearestSpatialLine(); } return; } else if (other.CompareTag("TriggerBipede")) { if (!triggerBipede) { triggerBipede = true; AkSoundEngine.PostEvent(GameManager.instance.triggerBipede1Sound, GameManager.instance.gameObject); } } else if (other.CompareTag("TriggerPorte")) { other.GetComponent <TriggerPorte>().SetSpeed(); } else if (other.CompareTag("Metal_Casier")) { overrideSurface = true; } else if (other.CompareTag("Hideout")) { isHidden = true; } else if (other.CompareTag("DetectZone")) { Enemy e = other.GetComponentInParent <Enemy>(); //e.DetectPlayer(true); //print("COLLISION ARAIGNEE"); } else if (other.CompareTag("Finish")) { AkSoundEngine.PostEvent("Stop_Random_Track1", GameManager.instance.gameObject); GameManager.instance.camHandler.DestroyTarget(); UIManager.instance.FadeInEnd(); } else if (other.CompareTag("Elevator")) { Elevator elevator = other.GetComponent <Elevator>(); if (elevator != null) { elevator.isPlayerOnBoard = true; elevator.StartMoving(); animator.SetBool("IsMoving", false); isInElevator = true; //print("elevator starts moving"); } } else if (other.CompareTag("NeedsCentering")) { needsCentering = true; } }