public BubbleDisplay(GameObject prefab) { backing = prefab.GetOrAddComponent <Image>(); TextMesh = backing.GetComponentInChildren <TextMeshProUGUI>(); rectTransform = backing.GetComponent <RectTransform>(); activeColorSet = ActivityColorSet.PlainWhite; }
public void ApplyConversationAesthetic(ConversationAesthetic aesthetic, bool isResponse = true, bool setInactive = true) { Color active = aesthetic.GetBubbleColor(isResponse); activeColorSet = new ActivityColorSet(active, active.ToOpacity()); activeColorSet.ApplyColorSetToImage(backing, !setInactive); TextMesh.color = aesthetic.GetTextColor(isResponse); }
protected override void Start() { base.Start(); this.buttonText = GetComponentInChildren <Text>(); this.toolkitMenu = GetComponentInParent <ToolkitMenu>(); this.transition = Transition.None; this.activityColors = ActivityColorSet.PlainWhite; this.onClick.AddListener(() => OnClickToggleSelection()); this.SetSelectedStatus(false); }
public void InitializeWidgetComponents() { if (craftingActionButtonActivated == null) { craftingActionButtonActivated = new CraftingActionWidgetActive(); } craftingActionButtonActivated.AddListener(OnWidgetActivated); image = gameObject.GetOrAddComponent <Image>(); rect = image.GetComponent <RectTransform>(); widgetText = GetComponentInChildren <TextMeshProUGUI>(); colorSet = new ActivityColorSet(Color.white, image.color); }