internal void Start() { if (SceneHelper.IsInTitle()) { SetUpWrapperTittle(); } if (SceneHelper.IsInGame()) { SetUpWrapperInGame(); HideBody(); } SetUpHands(); }
private static void AdjustScaler(Canvas canvas) { var scaler = canvas.GetComponent <CanvasScaler>(); if (scaler != null) { scaler.uiScaleMode = CanvasScaler.ScaleMode.ConstantPixelSize; scaler.scaleFactor = 1; scaler.referencePixelsPerUnit = 100; } if (SceneHelper.IsInTitle()) { canvas.transform.localScale = Vector3.one * 0.0015f; } else { canvas.transform.localScale = Vector3.one * 0.001f; } }
internal void Start() { if (SceneHelper.IsInGame()) { SetUpFlashbackCameraParent(); } if (SceneHelper.IsInSolarSystem()) { FixSleepTimerCanvas(); } if (SceneHelper.IsInTitle()) { FixTitleMenuCanvases(); FixStarLogos(); } ScreenCanvasesToWorld(); }
internal void Start() { SetUpLaserObject(); SetUpLeftHandLaser(); SetUpLineRenderer(); UpdateLineAppearance(); CreateButtonColliders(); if (SceneHelper.IsInGame()) { SetUpFirstPersonManipulator(); SetUpDialogueOptions(); _pauseMenuManager = FindObjectOfType <PauseMenuManager>(); } if (SceneHelper.IsInTitle()) { SetUpTitleAnimationHandler(); } }
private static void AddFollowTarget(Canvas canvas) { var followTarget = canvas.gameObject.AddComponent <FollowTarget>(); if (SceneHelper.IsInGame()) { followTarget.target = Locator.GetPlayerTransform(); followTarget.localPosition = new Vector3(0, 0.75f, 1.5f); } else if (SceneHelper.IsInTitle()) { followTarget.target = Camera.main.transform.parent; followTarget.localPosition = new Vector3(0, 1f, 2f); } else { followTarget.target = Camera.main.transform; followTarget.localPosition = new Vector3(0, 0, 2f); followTarget.positionSmoothTime = 0.5f; followTarget.rotationSmoothTime = 0.5f; } }
private void OnInteractChange(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState) { var value = newState ? 1 : 0; if (!SceneHelper.IsInGame()) { _buttons[JoystickButton.FaceLeft] = value; return; } var button = IsGripping ? JoystickButton.RightBumper : JoystickButton.FaceLeft; var isRepairPromptVisible = _repairPrompt != null && _repairPrompt.IsVisible(); var canRepairSuit = _playerResources.IsSuitPunctured() && OWInput.IsInputMode(InputMode.Character) && !ToolHelper.Swapper.IsSuitPatchingBlocked(); var isUsingTranslator = ToolHelper.Swapper.IsInToolMode(ToolMode.Translator); if (!isRepairPromptVisible && !canRepairSuit && !isUsingTranslator) { if (newState) { _primaryLastTime = fromAction.changedTime; } else { _primaryLastTime = -1; if (!_justHeld) { SimulateInput(button); } _justHeld = false; } } else { _buttons[button] = value; } }
private bool IsPaused() { return(OWTime.IsPaused(OWTime.PauseType.Menu) || OWTime.IsPaused(OWTime.PauseType.Sleeping) || SceneHelper.IsInTitle()); }
private bool IsMenuInteractionAllowed() { return(OWTime.IsPaused() || !SceneHelper.IsInGame() || PlayerState.IsSleepingAtCampfire()); }
private bool ShouldRenderHands() { return(!SceneHelper.IsInGame() || !PlayerHelper.IsWearingSuit()); }
private bool ShouldRenderGloves() { return(SceneHelper.IsInGame() && PlayerHelper.IsWearingSuit()); }
private void UpdateVisibility() { if (OWTime.IsPaused(OWTime.PauseType.Menu) || OWTime.IsPaused(OWTime.PauseType.Sleeping) || SceneHelper.IsInTitle()) { Show(); } else { Hide(); } }