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);
        }
示例#3
0
        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);
        }
示例#4
0
        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;
        }
示例#5
0
        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);
        }