/// <summary> /// Updates the clue from the image. /// </summary> /// <param name="image">The tracked image.</param> /// <param name="state">The image state.</param> public void UpdateRiddleFromImage(ARTrackedImage image, RuntimeRiddleClueState state) { string imageName = image.referenceImage.name; RuntimeRiddle riddle = this.GetRiddleFromImage(imageName); if (riddle != null) { riddle.UpdatePrefab(image, state); } }
/// <summary> /// Called when the riddle ui displayed. /// </summary> public void OnRiddleUIDisplayed() { this._viewableRiddle = this.riddleSet?.GetRuntimeRiddle(this._currentViewIndex); this.UpdateUIElements(this._viewableRiddle); // TODO: Animation this.uiElements.riddleCanvas.enabled = true; this.uiElements.playerUICanvas.enabled = false; this.uiElements.riddleScannedCanvas.enabled = false; }
public RuntimeRiddleManager(GameRiddleSet parentSet) { this._parentSet = parentSet; this._riddles = new List <RuntimeRiddle>(); foreach (GameRiddle riddle in parentSet) { RuntimeRiddle runtimeRiddle = new RuntimeRiddle(this, riddle); this._riddles.Add(runtimeRiddle); } }
private void UpdateUIElements(RuntimeRiddle riddle) { if (riddle == null) { this.uiElements.riddleName.text = ""; this.uiElements.riddleText.text = ""; return; } GameRiddle gameRiddle = riddle.GameRiddleData; RiddleReferenceData referenceData = gameRiddle.ClueData; this.uiElements.riddleName.text = referenceData.ClueTitle; this.uiElements.riddleText.text = referenceData.ClueDescription; }
/// <summary> /// Switches the riddle tot he next riddle. /// </summary> /// <param name="nextRiddle">The next riddle.</param> public void SwitchToRiddle(bool nextRiddle) { // TODO: Switch animation. if (nextRiddle) { this._currentViewIndex++; } else { this._currentViewIndex--; if (this._currentViewIndex < 0) { this._currentViewIndex = this.riddleSet.TotalRiddles - 1; } } this._currentViewIndex %= this.riddleSet.TotalRiddles; RuntimeRiddle riddle = this.riddleSet.GetRuntimeRiddle(this._currentViewIndex); this.UpdateUIElements(riddle); this._viewableRiddle = riddle; }
public bool ContainsRiddleFromImage(string imageName) { RuntimeRiddle clue = this.GetRiddleFromImage(imageName); return(clue != null); }
public bool OnRiddleFound(RuntimeRiddle riddle, ref PlayerScanResult result) { bool?output = this._parentSet?.OnRiddleFound(riddle.GameRiddleData, ref result); return(output.HasValue && output.Value); }