// Start is called before the first frame update void Start() { PauseMenu.SetActive(false); GameCamera.gameObject.SetActive(false); GameCamera.m_Lens.OrthographicSize = 6.2f; GameCamera.GetComponent <CinemachineCameraOffset>().m_Offset = new Vector3(0, 0, 0); MenuCamera.gameObject.SetActive(true); StartCoroutine(FadeIn()); music = this.GetComponent <AudioSource>(); music.clip = LayerClips[1]; music.Play(); resetting = false; }
private void Start() { lockOnCamCollider = lockOnCam.GetComponent <Cinemachine.CinemachineCollider>(); lockOnCamCollider.enabled = false; obstructionTime = 0; targets = group.m_Targets; closestEnemy = null; changedTarget = false; }
public void NextBound() { try { if (boundsIndex < cameraBounds.Length) { boundsIndex++; cam.GetComponent <CinemachineConfiner>().m_BoundingShape2D = cameraBounds[boundsIndex]; } } catch {} }
private void OnTriggerEnter(Collider other) { if (other.transform.root.gameObject.tag == "Player" && done == false) { var player = other.transform.root.gameObject; player.transform.position = standPosition.position; player.transform.rotation = standPosition.rotation; player.GetComponent <Animator>().SetBool("Victory", true); vmCamera.GetComponent <Animator>().SetTrigger("Victory"); StartCoroutine(DisplayText()); done = true; } }
public void CloseActivePanel(GameObject activeCanvas) { Player.GetComponent <KeyboardInput>().InternalRunning = true; _playerState.KeyboardInput = true; activeCanvas.SetActive(false); if (GameState == GameStates.LostLevel) { GameState = GameStates.Playing; SceneManager.LoadScene(CurrentLevel); if (LiveCamera != null) { LiveCamera.GetComponent <Cinemachine.CinemachineVirtualCamera>().Follow = Player.transform; } } }
private void OnTriggerEnter2D(Collider2D collision) { if (!collision.gameObject.CompareTag("showLevel") || collision.GetComponent <MovingObject>().HasCompletedPath()) { return; } if (collision.GetComponent <MovingObject>().IsMoving()) { cam.GetComponent <CinemachineConfiner>().m_BoundingShape2D = newBounds; collision.GetComponent <MovingObject>().StopMoving(); Player.getInstance().GetPlayerMovement().EnableMovement(); cam.Follow = player.transform; } }
private void _ShakeCamera() { vcam1.GetComponent <CinemachineCameraShaker>().ShakeCamera(cameraShakeDuration); }