public void SelectedCameraChanged(CamAnimator camAnimator) { //if (camAnimator != null) //{ // MeshRenderer meshRenderer = GetComponent<MeshRenderer>(); // if (meshRenderer != null) // meshRenderer.material.SetColor("_EmissionColor", camAnimator.GetCamObjColour()); //} }
public override void PlayerEnteredTrigger(CubeController player) { if (player != null) { CamAnimator camAnim = UDLRCameraController.GetSelectedCameraAnimator(); UDLRCameraController.RotateCameras(camAnim.transform, arcType, AnimCurve.MotionType.Linear); //transform.position = startingTransform.position; //transform.rotation = startingTransform.rotation; //transform.localScale = startingTransform.localScale; //if (camAnim != null) // camAnim.rotator.StartArc(camAnim.transform, arcType, Vector3.zero, AnimCurve.MotionType.Linear); } }
void TryStartRotation() { if (LevelController.GetMazeState() == LevelController.MazeState.InProgress) { CamAnimator camAnim = UDLRCameraController.GetSelectedCameraAnimator(); if (camAnim != null && camAnim.rotator.animationState == Rotator.AnimationState.Stationary) { rotator.StartArc(camAnim.transform, GetRotationDirection(), transform.position, AnimCurve.MotionType.Exponential); timeSinceLastRotationStart = 0.0f; needsStartRotation = false; } } }
public void OnRight(InputAction.CallbackContext context) { if (UDLRCameraController.Instance != null) { CubeController cubeController = GetCubeForCameraPanelPosition(UDLRCameraController.Instance.selectedPosition); if (cubeController != null) { //move cube according to selected camera CamAnimator selectedCam = UDLRCameraController.GetSelectedCameraAnimator(); Vector3 movementVec = selectedCam != null ? selectedCam.transform.right : Vector3.zero; movementVec.Normalize(); cubeController?.MoveInDirection(movementVec); lastMovementDirection = UIPanel.MovementDirection.Right; } } }