コード例 #1
0
 public void Highlight(bool highlight)
 {
     if (highlight)
     {
         _text.GetComponent <Text>().color = _color;
         _background.color = Color.black;
     }
     else
     {
         _text.GetComponent <Text>().color = Color.black;
         _background.color = _color;
     }
 }
コード例 #2
0
        public void Init(SurveyAnswer answer, Color color)
        {
            _color = color;
            if (_button == null)
            {
                _button = GetComponentInChildren <Button>();
            }
            _button.onClick.AddListener(() =>
            {
                onAnswer(answer.key, answer.buttonAction, this);
            });

            _text.InitTranslatedText(answer.key);
            _highlightedText.InitTranslatedText(answer.key);
            _highlightedText.GetComponent <Text>().color = color;
            _background.color = color;
        }