Beispiel #1
0
        public void ChangeStatus(IQuest reference, IQuest.Status status)
        {
            IQuest quest = this.GetQuest(reference.uniqueID);

            if (quest != null)
            {
                quest.ChangeStatus(status);
            }
        }
Beispiel #2
0
        // PUBLIC METHODS: ------------------------------------------------------------------------

        public void Setup(IQuest quest)
        {
            gameObject.SetActive(true);

            this.quest = quest;
            this.UpdateQuest();

            this.cacheStatus   = this.quest.status;
            this.cacheProgress = this.quest.progress;

            QuestsManager.Instance.questEvents.SetOnChange(this.OnQuestChange);
        }
        private void OnChangeQuestStatus(IQuest.Status status)
        {
            if (status == this.toStatus)
            {
                GameObject target = (HookPlayer.Instance == null
                    ? gameObject
                    : HookPlayer.Instance.gameObject
                                     );

                this.ExecuteTrigger(target);
            }
        }
Beispiel #4
0
        // PRIVATE METHODS: -----------------------------------------------------------------------

        private void OnQuestChange(string questID)
        {
            this.UpdateQuest();

            if (this.quest.status != this.cacheStatus ||
                !Mathf.Approximately(this.quest.progress, this.cacheProgress))
            {
                this.cacheStatus   = this.quest.status;
                this.cacheProgress = this.quest.progress;

                if (this.animator)
                {
                    this.animator.SetTrigger(this.triggerUpdate);
                }
            }
        }