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);
 }
        public static RiddleReferenceData GenerateReferenceData(string title, string desc)
        {
            RiddleReferenceData data = new RiddleReferenceData();

            data.riddleTitle       = title;
            data.riddleDescription = desc;
            return(data);
        }
Пример #3
0
        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>
        /// 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);
        }