Esempio n. 1
0
        public OperatorLayout(Node node) : base(node)
        {
            headerColor   = BuiltInColors.GetDark(_node.Type);
            headerColor.a = .8f;

            _node.OnTypeChanged += OnTypeChanged;
        }
Esempio n. 2
0
        public override void OnRepaint()
        {
            var   pin = Node.PinCollection.Get("Value");
            Color c   = BuiltInColors.GetDark(pin.VariableType);

            headerColor = c;
        }
Esempio n. 3
0
        public RandomNodeLayout(Node node) : base(node)
        {
            width         = 180;
            headerColor   = BuiltInColors.GetDark(_node.Type);
            headerColor.a = 1f;

            _node.OnTypeChanged += OnTypeChanged;
        }
Esempio n. 4
0
        protected override void InitFieldStyle()
        {
            base.InitFieldStyle();
            var background = VisualEditorGUIStyle.GetTexture(BuiltInColors.GetDark(_node.Type), new Color(0, 0, 0, 0), true, true, true, true);

            fieldStyle.normal.background  = background.Texture;
            fieldStyle.active.background  = background.Texture;
            fieldStyle.focused.background = background.Texture;
            fieldStyle.hover.background   = background.Texture;
        }
Esempio n. 5
0
        public CustomPaletteContext()
        {
            FullColors = new ObservableCollection <Color>(BuiltInColors.OrderBy(GetHue));
            CustomColors.CollectionChanged += CustomColors_CollectionChanged;

            Commands = new CommandBindingCollection(new [] {
                new CommandBinding(AddColorCmd, AddColorCmdExecuted),
                new CommandBinding(RemoveColorCmd, RemoveColorCmdExecuted)
            });
        }
Esempio n. 6
0
        /// <summary>
        /// On type changed
        /// </summary>
        void onTypeChanged()
        {
        #if UNITY_EDITOR
            Color = BuiltInColors.Get(VariableType);
            float r = Color.r * .5f;
            float g = Color.g * .5f;
            float b = Color.b * .5f;

            _emptyColor = new Color(r, g, b);
            _labelStyle = null;

            if (IsDynamicType && OnTypeChanged != null)
            {
                OnTypeChanged(this);
            }
        #endif
        }
Esempio n. 7
0
        public override void OnRepaint()
        {
            headerColor = BuiltInColors.GetDark(_node.Type);

            if (titleStyle != null)
            {
                GUIContent c    = new GUIContent(_node.PortalName);
                var        size = titleStyle.CalcSize(c);
                width = Mathf.Max(150, size.x + 2 * Pin.PIN_SIZE + 20);
            }
            else
            {
                width = 150;
            }

            MapConnections();
        }
Esempio n. 8
0
        protected override void InitGUIStyles()
        {
            buttonStyle          = new GUIStyle(GUI.skin.button);
            buttonStyle.fontSize = 9;
            buttonStyle.margin   = new RectOffset(0, 0, 0, 0);
            buttonStyle.padding  = new RectOffset(0, 0, 0, 0);

            foreach (var t in _availableTypes)
            {
                var color = BuiltInColors.Get(t);
                var tex   = VisualEditorGUIStyle.GetTexture(color, color, true, true, true, true);

                GUIStyle s = new GUIStyle(GUI.skin.box);
                s.normal.background = tex.Texture;
                s.border            = tex.BorderOffset;
                styles.Add(t, s);
            }
            base.InitGUIStyles();
        }
Esempio n. 9
0
        protected override void InitStyle()
        {
            base.InitStyle();
            titleStyle.fontSize  = 16;
            titleStyle.alignment = TextAnchor.UpperCenter;

            nameStyle           = new GUIStyle(titleStyle);
            nameStyle.fontSize  = 12;
            nameStyle.wordWrap  = true;
            nameStyle.alignment = TextAnchor.LowerCenter;
            nameStyle.fontStyle = FontStyle.Normal;

            var   pin = Node.PinCollection.Get("Value");
            Color c   = BuiltInColors.GetDark(pin.VariableType);

            var background = VisualEditorGUIStyle.GetTexture(c, new Color(0, 0, 0, 0), true, true, true, true);

            fieldStyle.normal.background  = background.Texture;
            fieldStyle.active.background  = background.Texture;
            fieldStyle.focused.background = background.Texture;
            fieldStyle.hover.background   = background.Texture;
        }
Esempio n. 10
0
 void OnTypeChanged()
 {
     headerColor = BuiltInColors.GetDark(_node.Type);
 }
Esempio n. 11
0
 public PortalExecutionLayout(PortalExecution node) : base(node)
 {
     headerColor = BuiltInColors.GetDark(typeof(ExecutableNode));
     width       = 150;
 }
Esempio n. 12
0
 public PortalVariableLayout(PortalVariable node) : base(node)
 {
     headerColor = BuiltInColors.GetDark(_node.Type);
     width       = 150;
 }
Esempio n. 13
0
 public LogicalLayout(Node node) : base(node)
 {
     headerColor   = BuiltInColors.GetDark(typeof(bool));
     headerColor.a = .8f;
 }
Esempio n. 14
0
        public void InitializeDefaults()
        {
            BuiltInColors.Clear();
            BuiltInColors.AddRange(
                GetColorSwatchItems(
                    new List <Color>()
            {
                Colors.Black,
                Colors.Red,
                Colors.DarkOrange,
                Colors.Yellow,
                Colors.LawnGreen,
                Colors.Blue,
                Colors.Purple,
                Colors.DeepPink,
                Colors.Aqua,
                Colors.SaddleBrown,
                Colors.Wheat,
                Colors.BurlyWood,
                Colors.Teal,

                Colors.White,
                Colors.OrangeRed,
                Colors.Orange,
                Colors.Gold,
                Colors.LimeGreen,
                Colors.DodgerBlue,
                Colors.Orchid,
                Colors.HotPink,
                Colors.Turquoise,
                Colors.SandyBrown,
                Colors.SeaGreen,
                Colors.SlateBlue,
                Colors.RoyalBlue,

                Colors.Tan,
                Colors.Peru,
                Colors.DarkBlue,
                Colors.DarkGreen,
                Colors.DarkSlateBlue,
                Colors.Navy,
                Colors.MistyRose,
                Colors.LemonChiffon,
                Colors.ForestGreen,
                Colors.Firebrick,
                Colors.DarkViolet,
                Colors.Aquamarine,
                Colors.CornflowerBlue,
                Colors.Bisque,
                Colors.WhiteSmoke,
                Colors.AliceBlue,


                Color.FromArgb(255, 5, 5, 5),
                Color.FromArgb(255, 15, 15, 15), Color.FromArgb(255, 35, 35, 35),
                Color.FromArgb(255, 55, 55, 55),
                Color.FromArgb(255, 75, 75, 75),
                Color.FromArgb(255, 95, 95, 95),
                Color.FromArgb(255, 115, 115, 115),
                Color.FromArgb(255, 135, 135, 135),
                Color.FromArgb(255, 155, 155, 155),
                Color.FromArgb(255, 175, 175, 175),
                Color.FromArgb(255, 195, 195, 195),
                Color.FromArgb(255, 215, 215, 215),
                Color.FromArgb(255, 235, 235, 235),
            }));

            CustomColors.Clear();
            CustomColors.AddRange(Enumerable.Repeat(Colors.White, NumColorsCustomSwatch)
                                  .Select(x => new ColorSwatchItem()
            {
                Color = x, HexString = x.ToHexString()
            })
                                  .ToList());
        }
Esempio n. 15
0
 public DebugLogLayout(Node node) : base(node)
 {
     headerColor = BuiltInColors.GetDark(typeof(string));
 }