Exemplo 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) & !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);
        }
Exemplo 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) & !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);
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
0
        public void Update()
        {
            if (Renderer == null)
            {
                return;
            }

            if (RainbowUtils.IsRainbow(Id))
            {
                RainbowUtils.SetRainbow(Renderer);
            }
        }
Exemplo n.º 5
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);
             * }*/
        }