private void Update() { if (!_isUnlocked) { //print("calling update"); ObjectFade.ImageFadeWithDistance(_lockImage, _distanceToShowLockImage, false); ObjectFade.TextFadeWithDistance(_doorText, _distanceToShowLockImage, false); } }
public void EndTutorialObject() { ObjectFade.TextFadeOut(_textObj, _fadeOutSpeed, true); if (_hasLine) { //_fadeInLine = false; ObjectFade.LineRendererFadeOut(_lineRendererObj, _fadeOutSpeed, true); } }
// Update is called once per frame void Update() { for (int i = 0; i < _positions.Length; i++) { _lineRendererObj.SetPosition(i, _positions[i].position); } if (_fadeIn) { ObjectFade.LineRendererFadeIn(_lineRendererObj, 1f, _fadeInSpeed); } }
// Update is called once per frame void Update() { if (_fadeIn) { ObjectFade.TextFadeIn(_textObj, 1f, _fadeInSpeed); } //_disableObjCounter -= Time.deltaTime; //if (_disableObjCounter <= 0) //{ // this.gameObject.SetActive(false); //} //if (_shouldDelay) //{ // if (_visibilityDelay > 0) // { // _visibilityDelay -= Time.deltaTime; // if (_visibilityDelay <= 0) // { // _textObj.gameObject.SetActive(true); // } // } //} //if (_textObj.gameObject.activeInHierarchy) //{ // if (_visibilityDuration > 0) // { // _visibilityDuration -= Time.deltaTime; // if (_visibilityDuration <= 0) // { // //_textObj.SetActive(false); // //this.gameObject.SetActive(false); // } // } //} if (_fadeOut) { ObjectFade.TextFadeOut(_textObj, _fadeOutSpeed, true); //print("trying to fade"); } if (_shouldMoveWithObj)// && _textObj.gameObject.activeInHierarchy) { GetPos(); } }
private void FillTriangle() { _triangleFillObj.fillAmount = Mathf.Lerp(_triangleFillObj.fillAmount, PlayerScript._triggerAxisNonDominant, Time.deltaTime * .75f); ObjectFade.ImageFadeWithDistance(_triangleFillObj, .75f, false); ObjectFade.ImageFadeWithDistance(_triangleOutlineObj, .75f, false); }
// Update is called once per frame void Update() { if (_hasLine) { for (int i = 0; i < _linePositions.Length; i++) { _lineRendererObj.SetPosition(i, _linePositions[i].position); } } //_deviceRight = SteamVR_Controller.Input((int)_trackedRight.index); //_deviceLeft = SteamVR_Controller.Input((int)_trackedLeft.index); if (!_endTutorialObject) { if (_tutorialText == TutorialTextObj.PressTriggerToMove) { if (PlayerScript._rightDominant) { _textObj.text = "HOLD THE LEFT TRIGGER TO MOVE"; } else { _textObj.text = "HOLD THE RIGHT TRIGGER TO MOVE"; } if (PlayerScript._triggerAxisNonDominant > .5) { _endTutorialObject = true; } } else if (_tutorialText == TutorialTextObj.PressTriggerToPickUpItem) { ObjectFade.TextFadeWithDistance(_textObj, 1.4f, false); if (PlayerScript._rightDominant) { _textObj.text = "Press the right trigger over objects to pickup items"; } else { _textObj.text = "Press the left trigger over objects to pickup items"; } if (PlayerScript._dominantHand.gameObject.activeInHierarchy) { if (PlayerScript._deviceDominant.GetPressDown(SteamVR_Controller.ButtonMask.Trigger)) { foreach (var item in _rightControllerManager._inventorySlots) { if (item.name == "Attic Key") { _endTutorialObject = true; } } } } } else if (_tutorialText == TutorialTextObj.PressTouchPadToBringUpInventory) { if (PlayerScript._rightDominant) { _textObj.text = "Press the right touchpad to access items"; } else { _textObj.text = "Press the left touchpad to access items"; } if (PlayerScript._dominantHand.gameObject.activeInHierarchy) { if (PlayerScript._deviceDominant.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad)) { _endTutorialObject = true; } } } else if (_tutorialText == TutorialTextObj.UseGunToAccessBlockedAreas) { ObjectFade.TextFadeWithDistance(_textObj, 1.5f, false); if (PlayerScript._dominantHand.gameObject.activeInHierarchy) { if (PlayerScript._deviceDominant.GetPressDown(SteamVR_Controller.ButtonMask.Trigger)) { foreach (var item in _rightControllerManager._inventorySlots) { if (item.name == "Pistol") { _endTutorialObject = true; } } } } } } if (_endTutorialObject) { EndTutorialObject(); if (_shouldDisableAfterEnd) { _disableObjCounter -= Time.deltaTime; if (_disableObjCounter <= 0) { this.gameObject.SetActive(false); } } } if (_fadeInLine && !_endTutorialObject) { ObjectFade.LineRendererFadeIn(_lineRendererObj, 1f, _fadeOutSpeed); } }
// Update is called once per frame void Update() { ObjectFade.TextLookAtFadeIn(_textObj, _angleToViewMin, _angleToViewMax, _fadeSpeed); }