Beispiel #1
0
        //-------------------------------------------------
        private Color LD46_BalloonColorToRGB(LD46_BalloonColor balloonColorVar)
        {
            Color defaultColor = new Color(255, 0, 0);

            switch (balloonColorVar)
            {
            case LD46_BalloonColor.Red:
                return(new Color(237, 29, 37, 255) / 255);

            case LD46_BalloonColor.OrangeRed:
                return(new Color(241, 91, 35, 255) / 255);

            case LD46_BalloonColor.Orange:
                return(new Color(245, 140, 31, 255) / 255);

            case LD46_BalloonColor.YellowOrange:
                return(new Color(253, 185, 19, 255) / 255);

            case LD46_BalloonColor.Yellow:
                return(new Color(254, 243, 0, 255) / 255);

            case LD46_BalloonColor.GreenYellow:
                return(new Color(172, 209, 54, 255) / 255);

            case LD46_BalloonColor.Green:
                return(new Color(0, 167, 79, 255) / 255);

            case LD46_BalloonColor.BlueGreen:
                return(new Color(108, 202, 189, 255) / 255);

            case LD46_BalloonColor.Blue:
                return(new Color(0, 119, 178, 255) / 255);

            case LD46_BalloonColor.VioletBlue:
                return(new Color(82, 80, 162, 255) / 255);

            case LD46_BalloonColor.Violet:
                return(new Color(102, 46, 143, 255) / 255);

            case LD46_BalloonColor.RedViolet:
                return(new Color(182, 36, 102, 255) / 255);

            case LD46_BalloonColor.LightGray:
                return(new Color(192, 192, 192, 255) / 255);

            case LD46_BalloonColor.DarkGray:
                return(new Color(128, 128, 128, 255) / 255);

            case LD46_BalloonColor.Random:
                int randomColor = Random.Range(0, 12);
                return(LD46_BalloonColorToRGB((LD46_BalloonColor)randomColor));
            }

            return(defaultColor);
        }
Beispiel #2
0
 //-------------------------------------------------
 public void SetColor(LD46_BalloonColor color)
 {
     GetComponentInChildren <MeshRenderer>().material.color = LD46_BalloonColorToRGB(color);
 }