Beispiel #1
0
 private void CreateButtonsPanel()
 {
     buttonsPanel = AddUIComponent <PanelBase>();
     buttonsPanel.Build(PanelType.None, new Layout(new Vector2(0.0f, 34.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10));
     buttonsPanel.padding = new RectOffset(10, 0, 5, 0);
     CreateResetButton();
     CreateSaveButton();
 }
Beispiel #2
0
 public override void Build(PanelType panelType, Layout layout)
 {
     base.Build(panelType, layout);
     labelPanel = AddUIComponent <PanelBase>();
     labelPanel.Build(PanelType.None, new Layout(new Vector2(0.0f, 18.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 0));
     CreateLabels();
     UIUtil.CreateSpace(390.0f, 1.0f, this);
     CreateSlider();
     UIUtil.CreateSpace(390.0f, 15.0f, this);
     Refresh();
 }
Beispiel #3
0
 private void RefreshSavedSwatchesPanel()
 {
     if (savedSwatchesPanel != null)
     {
         Destroy(savedSwatchesPanel.gameObject);
     }
     savedSwatchesPanel = AddUIComponent <PanelBase>();
     savedSwatchesPanel.Build(PanelType.None, new Layout(new Vector2(256.0f, 0.0f), true, LayoutDirection.Vertical, LayoutStart.TopLeft, 0));
     savedSwatchesPanel.padding = new RectOffset(5, 0, 5, 0);
     foreach (var savedSwatch in savedSwatches)
     {
         AddSavedSwatch(savedSwatch);
     }
 }
Beispiel #4
0
 private void RefreshSwatchesPanel()
 {
     if (swatchesPanel != null)
     {
         Destroy(swatchesPanel.gameObject);
     }
     swatchesPanel        = AddUIComponent <PanelBase>();
     swatchesPanel.zOrder = 0;
     swatchesPanel.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), false, LayoutDirection.Horizontal, LayoutStart.TopLeft, 5));
     swatchesPanel.autoFitChildrenHorizontally = false;
     swatchesPanel.autoLayout = true;
     swatchesPanel.width      = 256.0f;
     swatchesPanel.wrapLayout = true;
     swatchesPanel.autoFitChildrenVertically = true;
     swatchesPanel.padding = new RectOffset(10, 0, 10, 0);
     foreach (var swatch in NetworkSkinPanelController.Color.Swatches)
     {
         AddSwatch(swatch);
     }
 }
Beispiel #5
0
        private void CreateRGBPanel()
        {
            rgbPanel = AddUIComponent <PanelBase>();
            rgbPanel.Build(PanelType.None, new Layout(new Vector2(0.0f, 35.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 5));
            rgbPanel.padding = new RectOffset(10, 0, 5, 0);

            colorPanel = rgbPanel.AddUIComponent <UIPanel>();
            colorPanel.backgroundSprite = "WhiteRect";
            colorPanel.size             = new Vector2(28.0f, 25.0f);
            colorPanel.color            = NetworkSkinPanelController.Color.SelectedColor;
            colorPanel.atlas            = Resources.DefaultAtlas;

            Color32 color32 = colorPanel.color;

            CreateLabel(Translation.Instance.GetTranslation(TranslationID.LABEL_RED));
            redTextField = CreateTextfield(color32.r.ToString());
            CreateLabel(Translation.Instance.GetTranslation(TranslationID.LABEL_GREEN));
            greenTextField = CreateTextfield(color32.g.ToString());
            CreateLabel(Translation.Instance.GetTranslation(TranslationID.LABEL_BLUE));
            blueTextField = CreateTextfield(color32.b.ToString());
        }