private void OnScanned(PlayerScanResult scanResult) { if (scanResult.scanResult == PlayerScanResultType.RESULT_SUCCESS) { RiddleReferenceData referenceData = scanResult.riddleFound.ClueData; this.uiVariables.riddleFoundStatus.text = "Riddle Found:"; this.uiVariables.riddleNameText.text = referenceData.ClueTitle; this.uiVariables.riddleDescriptionText.text = referenceData.ClueDescription; } else if (scanResult.scanResult == PlayerScanResultType.RESULT_LINE_UP) { this.uiVariables.riddleFoundStatus.text = "Partial Object Scan"; this.uiVariables.riddleNameText.text = ""; this.uiVariables.riddleDescriptionText.text = "Unable to fully scan the object in this environment, line up the object with the camera."; } else if (scanResult.scanResult == PlayerScanResultType.RESULT_ALREADY_FOUND) { this.uiVariables.riddleFoundStatus.text = "Riddle Already Found!"; this.uiVariables.riddleNameText.text = ""; this.uiVariables.riddleDescriptionText.text = ""; } else if (scanResult.scanResult == PlayerScanResultType.RESULT_FAILED) { this.uiVariables.riddleFoundStatus.text = "No Objects Found"; this.uiVariables.riddleDescriptionText.text = "No objects were found in this environment."; this.uiVariables.riddleNameText.text = ""; } this._animator.Play(this.animations.inAnimation); }
/// <summary> /// Called to try and scan for clues in the areea. /// </summary> private void TryScanForClues() { if (!this.references.canPlayerScan.Value) { return; } PlayerScanResult scanResult = new PlayerScanResult(); scanResult.scanResult = PlayerScanResultType.RESULT_FAILED; RaycastHit raycast; if (Physics.Raycast( this.transform.position, this.transform.forward, out raycast)) { IScannable scannable = raycast.rigidbody.GetComponent <IScannable>(); if (scannable != null) { if (raycast.distance > this.maxDistance) { scanResult.scanResult = PlayerScanResultType.RESULT_LINE_UP; } else { scannable.OnScanned(this, raycast, ref scanResult); } } } this.references.canPlayerScan.Value = false; this.events.scanResultEvent?.CallEvent(scanResult); }
public void SetRiddleFound(ref PlayerScanResult result) { if (this.RiddleFound) { result.scanResult = PlayerScanResultType.RESULT_ALREADY_FOUND; return; } this._riddleFound = this._runtimeRiddleManager.OnRiddleFound(this, ref result); }
public bool OnRiddleFound(GameRiddle riddle, ref PlayerScanResult scanResult) { scanResult.scanResult = PlayerScanResultType.RESULT_SUCCESS; scanResult.riddleFound = riddle; if (this._riddlesLeft.Contains(riddle)) { this._riddlesLeft.Remove(riddle); } if (this._riddlesLeft.Count <= 0) { // TODO: Completed treasure hunt... return(true); } return(true); }
public bool OnRiddleFound(RuntimeRiddle riddle, ref PlayerScanResult result) { bool?output = this._parentSet?.OnRiddleFound(riddle.GameRiddleData, ref result); return(output.HasValue && output.Value); }
private void OnPlayerScanned(PlayerScanResult scanResult) { this.UpdateNumberOfRiddles(); }