Example #1
0
        private void OnObjectiveAdded(object sender, ObjectiveAddedEventArgs args)
        {
            if (this.ObjectiveTextPrefab == null || this.ObjectiveTextRoot == null)
            {
                return;
            }

            var interactableComponent = args.Objective.GetComponent<InteractableComponent>();

            if (interactableComponent == null)
            {
                return;
            }

            var textObject = Instantiate(this.ObjectiveTextPrefab);
            textObject.transform.SetParent(this.ObjectiveTextRoot, false);

            var text = textObject.GetComponent<Text>();

            if (text != null)
            {
                text.text = string.Format("{0}. {1}", args.Index, interactableComponent.Interaction);

                this.objectiveTexts.Add(args.Objective, text);
            }
        }
Example #2
0
 public void OnObjectiveAdded(object sender, ObjectiveAddedEventArgs args)
 {
     var handler = this.ObjectiveAdded;
     if (handler != null)
     {
         handler(sender, args);
     }
 }