private void OnAddRiddle() { if (!this._riddleDataHolder.HasValue) { Debug.Log("Riddle holder doesnt have anyting..."); return; } Debug.Log("Riddle should be added..."); RiddleDataHolder dataHolder = this._riddleDataHolder.Value; /* if(dataHolder.title.Length <= 0 || dataHolder.description.Length <= 0 || dataHolder.texture == null) || { || return; || } || || if(!this.editedRiddleSet.HasRiddleSet) || { || return; || } */ GameRiddle riddle = GameRiddle.Create( dataHolder.title, dataHolder.description, dataHolder.texture, prefab); this.editedRiddleSet.AddRiddle(riddle); this._riddleDataHolder = null; // TODO: Hide creator ui }
public void AddRiddle(GameRiddle riddle) { if (this.riddles.Contains(riddle)) { return; } this.riddles.Add(riddle); }
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; }
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); }
/// <summary> /// Creates a new game riddle based off of these parameters. /// </summary> /// <param name="riddleTitle">The riddle title.</param> /// <param name="riddleDescription">The riddle description</param> /// <param name="texture">The texture.</param> /// <param name="prefab">The prefab.</param> /// <returns>The game riddle output.</returns> public static GameRiddle Create(string riddleTitle, string riddleDescription, Texture2D texture, RiddleScannedComponent prefab) { GameRiddle newRiddle = GameRiddle.CreateInstance <GameRiddle>(); if (newRiddle != null) { Debug.Log(riddleTitle); string localizedName = ""; RiddleReferenceData referenceData = RiddleReferenceData.GenerateReferenceData( riddleTitle, riddleDescription); newRiddle.clueData = referenceData; RiddleReferenceImage imageData = RiddleReferenceImage.CreateImage( localizedName, texture, prefab); newRiddle.referenceImageData = imageData; newRiddle.clueLocalizedName = localizedName; newRiddle.name = localizedName; } return(newRiddle); }
public RuntimeRiddle(RuntimeRiddleManager runtimeRiddleManager, GameRiddle clue) { this._gameClue = clue; this._preScannedObject = null; this._runtimeRiddleManager = runtimeRiddleManager; }