void Awake() { ColorBlock cb; _button = this.gameObject.GetComponent <Button>(); _button.interactable = false; _button.onClick.AddListener(OnClick); cb = _button.colors; cb.highlightedColor = ColorConfig.GetColor("highlight"); cb.normalColor = ColorConfig.GetColor("adjacent"); cb.disabledColor = ColorConfig.GetColor("hidden"); _button.colors = cb; _graphic = GetComponent <RoomGraphic>(); AmbitionApp.Subscribe <RoomVO>(MapMessage.GO_TO_ROOM, HandleCurrentRoom); }
/// <summary> /// Gets the color. /// </summary> /// <param name="newColor">The newColor.</param> /// <returns></returns> public Color GetColor(Color newColor) { try { return(newColor != Color.Empty ? ColorConfig.GetColor(newColor) : Color.Empty); } catch (Exception ex) { Fail(ex); return(default(Color)); } }
private void LoadDefaultImage(int index) { /* * Index == 0 is reserved for NONE value */ if (index == 0) { return; } _settingsModel.TextureId = $"{DefaultTextures.DefaultPrefix}{_defaultImageDropdown.options[index].text.ToUpper()}.png"; _settingsModel.BackgroundColor = _defaultTextureColorColfig?.GetColor(_settingsModel.TextureId) ?? _settingsModel.BackgroundColor; Globals.SettingsHolder.UpdateSettings(_settingsModel); _defaultImageDropdown.value = -1; }