예제 #1
0
        public void Initialize(IDialogueUIController controller)
        {
            _controller = controller;

            int index = 0;

            foreach (var answer in GetComponentsInChildren <UIElementAnswer>())
            {
                var customAnswer = answer as ICustomAnswer;
                if (customAnswer != null)
                {
                    answer.Init(_controller);
                    _customAnswers.Add(customAnswer.ID, answer);
                }
                else
                {
                    answer.Init(_controller);
                    BindKeyToAnswer(index, answer);
                    _answers.Add(answer);
                    index++;
                }
            }

            // TESTING
            string message = "";

            if (Test(out message))
            {
                Debug.LogError(message);
                return;
            }
        }
예제 #2
0
        public override void Init(IDialogueUIController controller)
        {
            var button = GetComponentInChildren <Button>();

            button.onClick.AddListener(Select);
            button.onClick.AddListener(UpdateVariable);
            uiController = controller;
        }
예제 #3
0
 public virtual void Init(IDialogueUIController controller)
 {
     _button = GetComponent <Button>();
     if (_button != null)
     {
         _button.onClick.AddListener(Select);
     }
     uiController = controller;
 }
예제 #4
0
        public override void Init(IDialogueUIController controller)
        {
            base.Init(controller);

            _iconLibrary = GetComponentInParent <IconLibrary>();
        }