コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
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;
        }
コード例 #5
0
        /// <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;
        }
コード例 #6
0
        public bool ContainsRiddleFromImage(string imageName)
        {
            RuntimeRiddle clue = this.GetRiddleFromImage(imageName);

            return(clue != null);
        }
コード例 #7
0
        public bool OnRiddleFound(RuntimeRiddle riddle, ref PlayerScanResult result)
        {
            bool?output = this._parentSet?.OnRiddleFound(riddle.GameRiddleData, ref result);

            return(output.HasValue && output.Value);
        }