//When the highscore board is clicked and zoomed into protected override void _OpenUI() { if (!isActive) { AudioManager.Instance.PlayClip("subMenu"); // if there is a camera move, do it -- otherwise, just skip to the move being complete if (zoomTime > 0) { CameraManager.Callback cameraDoneFunction = delegate(){ CameraMoveDone(); }; CameraManager.Instance.ZoomToTarget(finalPosition, finalRotation, zoomTime, cameraDoneFunction); } else { CameraMoveDone(); } //Hide other UI objects NavigationUIManager.Instance.HidePanel(); HUDUIManager.Instance.HidePanel(); InventoryUIManager.Instance.HidePanel(); RoomArrowsUIManager.Instance.HidePanel(); isActive = true; highscoreBoard.GetComponent <Collider>().enabled = false; backButtonTween.Show(); } }
// When the zoomItem is clicked and zoomed into protected override void _OpenUI() { if (!isActive) { AudioManager.Instance.PlayClip("subMenu"); // Zoom into the item Vector3 targetPosition = zoomItemEntrance.transform.position + zoomOffset; CameraManager.Callback cameraDoneFunction = delegate(){ CameraMoveDone(); }; CameraManager.Instance.ZoomToTarget(targetPosition, zoomRotation, zoomTime, cameraDoneFunction); // Hide other UI objects NavigationUIManager.Instance.HidePanel(); InventoryUIManager.Instance.HidePanel(); RoomArrowsUIManager.Instance.HidePanel(); //need to disable more things here PetAnimationManager.Instance.DisableIdleAnimation(); PetMovement.Instance.canMove = false; isActive = true; zoomItemEntrance.GetComponent <Collider>().enabled = false; } }
// Copy of the base processClick method bad design here but not worth it to patch public void Pass() { if (!isCheckMood || DataManager.Instance.GameData.Stats.Mood > moodThreshold) { // Mark the crystal entrance used DataManager.Instance.GameData.MicroMix.EntranceHasCrystal = false; // lock the click manager ClickManager.Instance.Lock(); //Hide other UI Objects //Assuming that HUD is present at all scenes, so need to be hidden before scene change if (HUDUIManager.Instance != null) { HUDUIManager.Instance.HidePanel(); } if (NavigationUIManager.Instance != null) { NavigationUIManager.Instance.HidePanel(); } if (InventoryUIManager.Instance != null) { InventoryUIManager.Instance.HidePanel(); } RoomArrowsUIManager.Instance.HidePanel(); //Sent an change scene event out, so other objects can run appropriate logic before scene change if (OnChangeScene != null) { OnChangeScene(this, EventArgs.Empty); } //Save some basic data for current scene RememberCurrentScene(); //record that this entrance has been used if (entranceHelper != null) { entranceHelper.EntranceUsed(); } // if there is a camera move, do it -- otherwise, just skip to the move being complete if (zoomTime > 0) { CameraManager.Callback cameraDoneFunction = delegate() { CameraMoveDone(); }; CameraManager.Instance.ZoomToTarget(finalPosition, finalRotation, zoomTime, cameraDoneFunction); } else { CameraMoveDone(); } } else { PetSpeechAI.Instance.ShowSadMessage(); } }
/// <summary> /// Moves the camera to a target position with a /// target rotation over a set time. /// NOTE: If this function can ever "fail", be sure to /// check ZoomHelper because it assumes this function /// will always work. /// </summary> /// <param name="position">Position.</param> /// <param name="rotation">Rotation.</param> /// <param name="time">Time.</param> /// <param name="cameraDoneCallback">Callback function on camera done moving</param> public void ZoomToTarget(Vector3 position, Vector3 rotation, float time, CameraManager.Callback cameraDoneCallback) { // Before zooming, cache the camera position initPosition = gameObject.transform.position; initFaceDirection = gameObject.transform.eulerAngles; isZoomed = true; isZoomingAux = true; // Set the flag to true isMoving = true; MoveCamera(position, rotation, time, cameraDoneCallback); }
private void MoveCamera(Vector3 position, Vector3 rotation, float time, CameraManager.Callback cameraDoneCallback) { // Make sure to subtract the camera's parent's position from the vPos because the parent moves as the partitions pan position -= gameObject.transform.parent.position; // If the incoming object isn't null, set up a callback if (cameraDoneCallback != null) { FinishCameraMoveCallback = cameraDoneCallback; // Cache the callback } // Kick off the move and rotation tweens LeanTween.moveLocal(gameObject, position, time).setEase(LeanTweenType.easeInOutQuad).setOnComplete(MoveCameraDone); LeanTween.rotateLocal(gameObject, rotation, time).setEase(LeanTweenType.easeInOutQuad); }
private void ZoomInToMiniPet(System.Object sender, EventArgs args) { isAdded = false; OpenChildUI(); // Further child UI calls //if pet not finish eating yet. finish eating logic Vector3 position = this.transform.position + zoomPositionOffset; isMiniPetColliderLocked = true; CameraManager.Callback cameraDoneFunction = delegate() { CameraMoveDone(); }; miniPetSpeechAI.PetSpeechZoomToggle(true); CameraManager.Instance.ZoomToTarget(position, zoomRotation, 0.5f, cameraDoneFunction); PetMovement.Instance.OnReachedDest -= ZoomInToMiniPet; }