public static ColorStatic Create(System.Byte r, System.Byte g, System.Byte b)
            {
                ColorStatic cs = _new();

                cs.red = r; cs.green = g; cs.blue = b;
                return(cs);
            }
            void OnEnable()
            {
                cs = (ColorStatic)target;

                color         = UnityEngine.ScriptableObject.CreateInstance <ColorPicker>();
                color.color.r = cs.red / 255.0f;
                color.color.g = cs.green / 255.0f;
                color.color.b = cs.blue / 255.0f;
                color.color.a = 1.0f;
            }
Ejemplo n.º 3
0
    private ColorHandler StaticColorHandler()
    {
        MouseZoneLogo zone = UnityEngine.ScriptableObject.CreateInstance <MouseZoneLogo>();
        RateStatic    rate = ScriptableObject.CreateInstance <RateStatic>();

        rate.frequency   = 0;
        rate.repeatLimit = 0;

        ColorStatic cyan = ColorStatic.Create(0, 194, 255);

        return(ColorHandler.Create(zone, IlluminationMode.Color, cyan, rate));
    }
Ejemplo n.º 4
0
    private ColorHandler RangedColorHandler()
    {
        KeyboardZoneMainKeyboard zone = UnityEngine.ScriptableObject.CreateInstance <KeyboardZoneMainKeyboard>();

        ColorStatic cyan  = ColorStatic.Create(0, 194, 255);
        ColorStatic green = ColorStatic.Create(0, 255, 0);
        ColorStatic red   = ColorStatic.Create(255, 0, 0);

        ColorRange cyanRange  = new ColorRange(0, 10, cyan);
        ColorRange redRange   = new ColorRange(10, 20, red);
        ColorRange greenRange = new ColorRange(20, 100, green);

        ColorRange[] ranges = { cyanRange, redRange, greenRange };

        return(ColorHandler.Create(zone, IlluminationMode.Color, ColorRanges.Create(ranges)));
    }
            public static ColorHandler Create(DeviceZone.AbstractIlluminationDevice_Zone dz, IlluminationMode mode, ColorStatic color, RateStatic rate)
            {
                ColorHandler ch = Create(dz, mode);

                ch.color_static = color;
                ch.rate_static  = rate;
                return(ch);
            }
Ejemplo n.º 6
0
 public ColorRange(System.UInt32 low, System.UInt32 high, ColorStatic color)
 {
     this.low = low; this.high = high; color_static = color;
 }
            private static ColorStatic _new()
            {
                ColorStatic cs = UnityEngine.ScriptableObject.CreateInstance <ColorStatic>();

                return(cs);
            }