Esempio n. 1
0
        public bool Update()
        {
            var currentTime = Time.time;
            var alpha       = Mathf.Max((1f - ((currentTime - _time) / Duration)), 0f);

            if (alpha < 0 || alpha > 1)
            {
                alpha = 0;
            }

            if (RainbowUtils.IsRainbow(Player.Data.ColorId) & !CustomGameOptions.AnonymousFootPrint)
            {
                Color = RainbowUtils.Rainbow;
            }

            Color = new Color(Color.r, Color.g, Color.b, alpha);
            _spriteRenderer.color = Color;

            if (_time + (int)Duration < currentTime)
            {
                Destroy();
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public bool Update()
        {
            var currentTime = Time.time;
            var alpha       = Mathf.Max(1f - (currentTime - _time) / Duration, 0f);

            if (alpha < 0 || alpha > 1)
            {
                alpha = 0;
            }

            if (RainbowUtils.IsRainbow(Player.Data.ColorId) & !Grey)
            {
                Color = RainbowUtils.Rainbow;
            }
            else if (Grey)
            {
                Color = new Color(0.2f, 0.2f, 0.2f, 1f);
            }
            else
            {
                Color = Palette.PlayerColors[Player.Data.ColorId];
            }

            Color = new Color(Color.r, Color.g, Color.b, alpha);
            _spriteRenderer.color = Color;

            if (_time + (int)Duration < currentTime)
            {
                Destroy();
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
 // If the R, G, or B values change, use this
 // code to update the HSV values and invalidate
 // the color wheel (so it updates the pointers).
 // Check the isInUpdate flag to avoid recursive events
 // when you update the NumericUpdownControls.
 private void HandleRGBScroll(object sender, ScrollEventArgs e)
 {
     _changeType = ChangeStyle.RGB;
     RGB         = new DRColor.RGB(hsbRed.Value, hsbGreen.Value, hsbBlue.Value);
     SetHSV(new DRColor.HSV(RGB));
     SetRGBLabels(RGB);
     this.Invalidate();
     RainbowUtils.fillBoth(RGB);
 }
Esempio n. 4
0
 // If the H, S, or V values change, use this
 // code to update the RGB values and invalidate
 // the color wheel (so it updates the pointers).
 // Check the isInUpdate flag to avoid recursive events
 // when you update the NumericUpdownControls.
 private void HandleHSVScroll(object sender, ScrollEventArgs e)
 {
     _changeType = ChangeStyle.HSV;
     HSV         = new DRColor.HSV(hsbHue.Value, hsbSaturation.Value, hsbBrightness.Value);
     SetRGB(new DRColor.RGB(HSV));
     SetHSVLabels(HSV);
     this.Invalidate();
     RainbowUtils.fillBoth(RGB);
 }
Esempio n. 5
0
        private void colorWheel_Changed(object sender, ColorChangedEventArgs e)
        {
            if (e.RGB == null || e.HSV == null)
            {
                return;
            }

            SetRGB(e.RGB);
            SetHSV(e.HSV);
            RainbowUtils.fillBoth(e.RGB);
        }
Esempio n. 6
0
        public static bool Prefix([HarmonyArgument(0)] int colorId, [HarmonyArgument(1)] Renderer rend)
        {
            var r = rend.gameObject.GetComponent <RainbowBehaviour>();

            if (r == null)
            {
                r = rend.gameObject.AddComponent <RainbowBehaviour>();
            }

            r.AddRend(rend, colorId);
            return(!RainbowUtils.IsRainbow(colorId));
        }
        public void Update()
        {
            if (Renderer == null)
            {
                return;
            }

            if (RainbowUtils.IsRainbow(Id))
            {
                RainbowUtils.SetRainbow(Renderer);
            }
        }
Esempio n. 8
0
        public void Update()
        {
            if (Renderer == null)
            {
                return;
            }

            if (RainbowUtils.IsRainbow(Id))
            {
                RainbowUtils.SetRainbow(Renderer);
            }

            /*else if (RainbowUtils.IsGalaxy(Id))
             * {
             *  RainbowUtils.SetGalaxy(Renderer);
             * }
             * else if (RainbowUtils.IsFire(Id))
             * {
             *  RainbowUtils.SetFire(Renderer);
             * }*/
        }
Esempio n. 9
0
 public LedRestClient(string url, string port, int ledCount)
 {
     _URLWithPort = $"http://{url}:{port}";
     _HttpClient  = new RestClient(_URLWithPort);
     _Buffer      = RainbowUtils.createEmptyArray(ledCount);
 }