예제 #1
0
        private void OpenColorMenu()
        {
            SelectionFilter selectionFilter = selectionGizmo.selectionFilter;

            GameController.CursorFocusUI(true);
            if (!selectionFilter.IsMultiSelection)
            {
                fillColor = selectionFilter.GetSelectedGameObjects()[0].GetComponent <ChildScript>().GetColor();
            }
            ColorPicker.Create(this.fillColor, "colortool",
                               selectedColor =>
            {
                if (!selectionFilter.IsMultiSelection)
                {
                    selectionFilter.GetSelectedGameObjects()[0].GetComponent <ChildScript>().SetColor(selectedColor);
                }
            },
                               selectedColor =>
            {
                if (fillColor == selectedColor)
                {
                    return;
                }
                fillColor = selectedColor;
                foreach (GameObject selectedGameObject in selectionFilter.GetSelectedGameObjects())
                {
                    if (selectedGameObject.TryGetComponent <ChildScript>(out var component))
                    {
                        component.SetColor(selectedColor);
                    }
                }
예제 #2
0
 public void ChooseColorButtonClick()
 {
     ColorPicker.Create(r.sharedMaterial.color, "Choose the cube's color!", SetColor, ColorFinished, true);
 }
 //choose color button call
 public void ChooseColor()
 {
     ColorPicker.Create(colorKeys[selectedColorKey].color, "Gradient Color Key", (c) => UpdateColor(selectedColorKey, c), null);
 }
예제 #4
0
 public void OnClickChooseColor()
 {
     selectedColorButton   = EventSystem.current.currentSelectedGameObject;
     selectedColorButtonID = EventSystem.current.currentSelectedGameObject.GetComponent <ColorChooserButton>().ButtonID;
     ColorPicker.Create(colors[selectedColorButtonID], "Choose color", onColorChanged, onColorSelected, false);
 }