private void OnEnable() { colorButton.Initialize(ping != null ? CustomPings.GetColor(ping.colorIndex) : Color.white); colorPicker.Initialize(ping); iconButton.Initialize(Color.clear); iconPicker.Initialize(ping); }
private void Update() { if (ping != null && colorButton != null) { colorButton.image.color = CustomPings.GetColor(ping.colorIndex); } label.gameObject.SetActive(!iconPicker.gameObject.activeSelf); }
public override void Open() { var color = CustomPings.GetColor(target.colorIndex); for (int i = 0; i < buttons.Count; ++i) { var button = buttons[i]; button.image.color = color; } base.Open(); int initialPage = GetPageForType(target.pingType); ShowPage(initialPage); }
public void Initialize(PingInstance target) { base.Initialize(); this.target = target; var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); for (int i = 0; i < buttons.Count; ++i) { var button = buttons[i]; button.Initialize(i, CustomPings.GetColor(i), i == target.colorIndex, sprite); } onSelect = OnSelect; }
public void Initialize(PingInstance target) { base.Initialize(); this.target = target; var names = Enum.GetNames(typeof(PingType)); var values = (PingType[])Enum.GetValues(typeof(PingType)); var color = CustomPings.GetColor(target.colorIndex); for (int i = 0; i < buttons.Count; ++i) { var button = buttons[i]; var name = names[i + 1]; var value = values[i + 1]; var sprite = SpriteManager.Get(SpriteManager.Group.Pings, name); button.Initialize(i, color, value == target.pingType, sprite); } onSelect = OnSelect; int initialPage = GetPageForType(target.pingType); ShowPage(initialPage); }