private void SetPlayMode(bool isPreview) { isPreviewMode = isPreview; OnPreviewModeChanged?.Invoke(isPreview); if (DCLCharacterController.i) { DCLCharacterController.i.SetPosition(defaultCharacterPosition); DCLCharacterController.i.gameObject.SetActive(isPreview); DCLCharacterController.i.ResetGround(); } if (mouseCatcher != null) { mouseCatcher.enabled = isPreview; if (!isPreview) { mouseCatcher.UnlockCursor(); } } cameraController?.gameObject.SetActive(isPreviewMode); cursorController?.gameObject.SetActive(isPreviewMode); if (!isPreview) { HideHUDs(); } SetCaptureKeyboardInputEnabled(isPreview); }
public void SetCardActive(bool active) { if (active && mouseCatcher != null) { mouseCatcher.UnlockCursor(); } cardCanvas.enabled = active; CommonScriptableObjects.playerInfoCardVisibleState.Set(active); }
public void SetCardActive(bool active) { if (active && mouseCatcher != null) { mouseCatcher.UnlockCursor(); } else if (!active) { CatalogController.RemoveWearablesInUse(loadedWearables); loadedWearables.Clear(); } cardCanvas.enabled = active; CommonScriptableObjects.playerInfoCardVisibleState.Set(active); }
void Update() { if (inputDetectionPausedFrames > 0) { inputDetectionPausedFrames--; return; } if (Input.GetKeyDown(KeyCode.Return)) { if (owner != null && owner.scene != null && owner.scene.isPersistent && !inputField.isFocused) { inputField.Select(); mouseCatcher.UnlockCursor(); } } }
/// <summary> /// Step initialization (occurs before OnStepExecute() execution). /// </summary> public virtual void OnStepStart() { tutorialController = TutorialController.i; stepAnimator = GetComponent <Animator>(); mouseCatcher = InitialSceneReferences.i?.mouseCatcher; if (unlockCursorAtStart) { mouseCatcher?.UnlockCursor(); } if (tutorialController != null) { tutorialController.ShowTeacher3DModel(show3DTeacherAtStart); if (tutorialController.teacher != null) { if (tutorialController.currentStepIndex > 0) { tutorialController.teacher.PlaySpeakSound(); } else { tutorialController.teacher.PlayHappySound(1f); } } if (show3DTeacherAtStart && teacherPositionRef != null) { tutorialController.SetTeacherPosition(teacherPositionRef.position); if (tutorialController.teacher.isHiddenByAnAnimation) { tutorialController.teacher.PlayAnimation(TutorialTeacher.TeacherAnimation.Reset); } } } ConfigureSkipOptions(); }