static DebugMatsRandom()
 {
     for (int i = 0; i < 100; i++)
     {
         DebugMatsRandom.mats[i] = SolidColorMaterials.SimpleSolidColorMaterial(new Color(Rand.Value, Rand.Value, Rand.Value, 0.25f), false);
     }
 }
 static DebugMatsRandom()
 {
     mats = new Material[100];
     for (int i = 0; i < 100; i++)
     {
         mats[i] = SolidColorMaterials.SimpleSolidColorMaterial(new Color(Rand.Value, Rand.Value, Rand.Value, 0.25f));
     }
 }
Exemplo n.º 3
0
 private void CreateMaterialIfNeeded(bool careAboutVertexColors)
 {
     if (this.material == null || this.materialCaresAboutVertexColors != careAboutVertexColors)
     {
         this.material = SolidColorMaterials.SimpleSolidColorMaterial(new Color(this.giver.Color.r, this.giver.Color.g, this.giver.Color.b, this.opacity * this.giver.Color.a), careAboutVertexColors);
         this.materialCaresAboutVertexColors = careAboutVertexColors;
         this.material.renderQueue           = 3600;
     }
 }
Exemplo n.º 4
0
 public static Material MaterialOf(Color col)
 {
     if (colorMatDict.TryGetValue(col, out Material value))
     {
         return(value);
     }
     value = SolidColorMaterials.SimpleSolidColorMaterial(col);
     colorMatDict.Add(col, value);
     return(value);
 }
 private void CreateMaterialIfNeeded(bool careAboutVertexColors)
 {
     if (material == null || materialCaresAboutVertexColors != careAboutVertexColors)
     {
         Color color = colorGetter();
         material = SolidColorMaterials.SimpleSolidColorMaterial(new Color(color.r, color.g, color.b, opacity * color.a), careAboutVertexColors);
         materialCaresAboutVertexColors = careAboutVertexColors;
         material.renderQueue           = renderQueue;
     }
 }
Exemplo n.º 6
0
        public static Material MaterialOf(Color col)
        {
            Material material = default(Material);

            if (DebugSolidColorMats.colorMatDict.TryGetValue(col, out material))
            {
                return(material);
            }
            material = SolidColorMaterials.SimpleSolidColorMaterial(col, false);
            DebugSolidColorMats.colorMatDict.Add(col, material);
            return(material);
        }
Exemplo n.º 7
0
        static TexUI()
        {
            // Note: this type is marked as 'beforefieldinit'.
            ColorInt colorInt = new ColorInt(51, 63, 51, 200);

            TexUI.GrayBg = SolidColorMaterials.NewSolidColorTexture(colorInt.ToColor);
            ColorInt colorInt2 = new ColorInt(32, 32, 32, 255);

            TexUI.AvailResearchColor = colorInt2.ToColor;
            ColorInt colorInt3 = new ColorInt(0, 64, 64, 255);

            TexUI.ActiveResearchColor = colorInt3.ToColor;
            ColorInt colorInt4 = new ColorInt(0, 64, 16, 255);

            TexUI.FinishedResearchColor = colorInt4.ToColor;
            ColorInt colorInt5 = new ColorInt(42, 42, 42, 255);

            TexUI.LockedResearchColor = colorInt5.ToColor;
            ColorInt colorInt6 = new ColorInt(0, 0, 0, 255);

            TexUI.RelatedResearchColor = colorInt6.ToColor;
            ColorInt colorInt7 = new ColorInt(30, 30, 30, 255);

            TexUI.HighlightBgResearchColor = colorInt7.ToColor;
            ColorInt colorInt8 = new ColorInt(160, 160, 160, 255);

            TexUI.HighlightBorderResearchColor = colorInt8.ToColor;
            ColorInt colorInt9 = new ColorInt(80, 80, 80, 255);

            TexUI.DefaultBorderResearchColor = colorInt9.ToColor;
            ColorInt colorInt10 = new ColorInt(60, 60, 60, 255);

            TexUI.DefaultLineResearchColor = colorInt10.ToColor;
            ColorInt colorInt11 = new ColorInt(51, 205, 217, 255);

            TexUI.HighlightLineResearchColor = colorInt11.ToColor;
            TexUI.FastFillTex   = Texture2D.whiteTexture;
            TexUI.FastFillStyle = new GUIStyle
            {
                normal = new GUIStyleState
                {
                    background = TexUI.FastFillTex
                }
            };
            TexUI.TextBGBlack = ContentFinder <Texture2D> .Get("UI/Widgets/TextBGBlack", true);

            TexUI.GrayTextBG = ContentFinder <Texture2D> .Get("UI/Overlays/GrayTextBG", true);

            TexUI.FloatMenuOptionBG = ContentFinder <Texture2D> .Get("UI/Widgets/FloatMenuOptionBG", true);

            TexUI.GrayscaleGUI = MatLoader.LoadMat("Misc/GrayscaleGUI", -1);
        }
Exemplo n.º 8
0
        public static Material MaterialOf(Color col)
        {
            Material material;
            Material result;

            if (DebugSolidColorMats.colorMatDict.TryGetValue(col, out material))
            {
                result = material;
            }
            else
            {
                material = SolidColorMaterials.SimpleSolidColorMaterial(col, false);
                DebugSolidColorMats.colorMatDict.Add(col, material);
                result = material;
            }
            return(result);
        }
Exemplo n.º 9
0
 private void CreateMaterialIfNeeded(bool careAboutVertexColors)
 {
     if (material == null || materialCaresAboutVertexColors != careAboutVertexColors)
     {
         Color color  = giver.Color;
         float r      = color.r;
         Color color2 = giver.Color;
         float g      = color2.g;
         Color color3 = giver.Color;
         float b      = color3.b;
         float num    = opacity;
         Color color4 = giver.Color;
         material = SolidColorMaterials.SimpleSolidColorMaterial(new Color(r, g, b, num * color4.a), careAboutVertexColors);
         materialCaresAboutVertexColors = careAboutVertexColors;
         material.renderQueue           = 3600;
     }
 }
        public static Material SimpleSolidColorMaterial(Color col, bool careAboutVertexColors = false)
        {
            Material material = default(Material);

            if (careAboutVertexColors)
            {
                if (!SolidColorMaterials.simpleColorAndVertexColorMats.TryGetValue(col, out material))
                {
                    material = SolidColorMaterials.NewSolidColorMaterial(col, ShaderDatabase.VertexColor);
                    SolidColorMaterials.simpleColorAndVertexColorMats.Add(col, material);
                }
            }
            else if (!SolidColorMaterials.simpleColorMats.TryGetValue(col, out material))
            {
                material = SolidColorMaterials.NewSolidColorMaterial(col, ShaderDatabase.SolidColor);
                SolidColorMaterials.simpleColorMats.Add(col, material);
            }
            return(material);
        }
Exemplo n.º 11
0
        private void CreateMaterialIfNeeded(bool careAboutVertexColors)
        {
            if (!((Object)this.material == (Object)null) && this.materialCaresAboutVertexColors == careAboutVertexColors)
            {
                return;
            }
            Color color  = this.giver.Color;
            float r      = color.r;
            Color color2 = this.giver.Color;
            float g      = color2.g;
            Color color3 = this.giver.Color;
            float b      = color3.b;
            float num    = this.opacity;
            Color color4 = this.giver.Color;

            this.material = SolidColorMaterials.SimpleSolidColorMaterial(new Color(r, g, b, num * color4.a), careAboutVertexColors);
            this.materialCaresAboutVertexColors = careAboutVertexColors;
            this.material.renderQueue           = 3600;
        }
Exemplo n.º 12
0
        public static Material Get(Color[] spectrum, float val, Shader shader)
        {
            Color col = ColorsFromSpectrum.Get(spectrum, val);

            return(SolidColorMaterials.NewSolidColorMaterial(col, shader));
        }
 public static Texture2D NewSolidColorTexture(float r, float g, float b, float a)
 {
     return(SolidColorMaterials.NewSolidColorTexture(new Color(r, g, b, a)));
 }