Example #1
0
 // Token: 0x06001CE5 RID: 7397 RVA: 0x000F2088 File Offset: 0x000F0288
 public static Material MatFrom(string texPath, Shader shader, Color color, int renderQueue)
 {
     return(AvaliMaterialPool.MatFrom(new AvaliMaterialRequest(ContentFinder <Texture2D> .Get(texPath, true), shader, color)
     {
         renderQueue = renderQueue
     }));
 }
Example #2
0
 // Token: 0x06001CE1 RID: 7393 RVA: 0x000F2034 File Offset: 0x000F0234
 public static Material MatFrom(Texture2D srcTex, Shader shader, Color color, int renderQueue)
 {
     return(AvaliMaterialPool.MatFrom(new AvaliMaterialRequest(srcTex, shader, color)
     {
         renderQueue = renderQueue
     }));
 }
Example #3
0
 // Token: 0x06001CDE RID: 7390 RVA: 0x0001A0E4 File Offset: 0x000182E4
 public static Material MatFrom(string texPath)
 {
     if (texPath == null || texPath == "null")
     {
         return(null);
     }
     return(AvaliMaterialPool.MatFrom(new AvaliMaterialRequest(ContentFinder <Texture2D> .Get(texPath, true))));
 }
Example #4
0
        public override void Init(AvaliGraphicRequest req)
        {
            this.data       = req.graphicData;
            this.path       = req.path;
            this.color      = req.color;
            this.colorTwo   = req.colorTwo;
            this.colorThree = req.colorThree;
            this.drawSize   = req.drawSize;
            Texture2D[] texture2DArray1 = new Texture2D[this.mats.Length];
            texture2DArray1[0] = ContentFinder <Texture2D> .Get(req.path + "_north", false);

            texture2DArray1[1] = ContentFinder <Texture2D> .Get(req.path + "_east", false);

            texture2DArray1[2] = ContentFinder <Texture2D> .Get(req.path + "_south", false);

            texture2DArray1[3] = ContentFinder <Texture2D> .Get(req.path + "_west", false);

            if (texture2DArray1[0] == null)
            {
                if (texture2DArray1[2] != null)
                {
                    texture2DArray1[0] = texture2DArray1[2];
                    this.drawRotatedExtraAngleOffset = 180f;
                }
                else if (texture2DArray1[1] != null)
                {
                    texture2DArray1[0] = texture2DArray1[1];
                    this.drawRotatedExtraAngleOffset = -90f;
                }
                else if (texture2DArray1[3] != null)
                {
                    texture2DArray1[0] = texture2DArray1[3];
                    this.drawRotatedExtraAngleOffset = 90f;
                }
                else
                {
                    texture2DArray1[0] = ContentFinder <Texture2D> .Get(req.path, false);
                }
            }
            if (texture2DArray1[0] == null)
            {
                Log.Error("Failed to find any textures at " + req.path + " while constructing " + this.ToStringSafe <AvaliGraphic_Multi>(), false);
            }

            else
            {
                if (texture2DArray1[2] == null)
                {
                    texture2DArray1[2] = texture2DArray1[0];
                }
                if (texture2DArray1[1] == null)
                {
                    if (texture2DArray1[3] != null)
                    {
                        texture2DArray1[1] = texture2DArray1[3];
                        this.eastFlipped   = this.DataAllowsFlip;
                    }
                    else
                    {
                        texture2DArray1[1] = texture2DArray1[0];
                    }
                }
                if (texture2DArray1[3] == null)
                {
                    if (texture2DArray1[1] != null)
                    {
                        texture2DArray1[3] = texture2DArray1[1];
                        this.westFlipped   = this.DataAllowsFlip;
                    }
                    else
                    {
                        texture2DArray1[3] = texture2DArray1[0];
                    }
                }
                Texture2D[] texture2DArray2 = new Texture2D[this.mats.Length];
                //if (req.shader.SupportsMaskTex())
                if (req.shader == AvaliShaderDatabase.Tricolor)
                {
                    //Log.Message("Generating MaskTex");
                    texture2DArray2[0] = ContentFinder <Texture2D> .Get(req.path + "_northm", false);

                    texture2DArray2[1] = ContentFinder <Texture2D> .Get(req.path + "_eastm", false);

                    texture2DArray2[2] = ContentFinder <Texture2D> .Get(req.path + "_southm", false);

                    texture2DArray2[3] = ContentFinder <Texture2D> .Get(req.path + "_westm", false);

                    if (texture2DArray2[0] == null)
                    {
                        if (texture2DArray2[2] != null)
                        {
                            texture2DArray2[0] = texture2DArray2[2];
                        }
                        else if (texture2DArray2[1] != null)
                        {
                            texture2DArray2[0] = texture2DArray2[1];
                        }
                        else if (texture2DArray2[3] != null)
                        {
                            texture2DArray2[0] = texture2DArray2[3];
                        }
                    }
                    if (texture2DArray2[2] == null)
                    {
                        texture2DArray2[2] = texture2DArray2[0];
                    }
                    if (texture2DArray2[1] == null)
                    {
                        texture2DArray2[1] = !(texture2DArray2[3] != null) ? texture2DArray2[0] : texture2DArray2[3];
                    }
                    if (texture2DArray2[3] == null)
                    {
                        texture2DArray2[3] = !(texture2DArray2[1] != null) ? texture2DArray2[0] : texture2DArray2[1];
                    }
                }
                for (int index = 0; index < this.mats.Length; ++index)
                {
                    //this.mats[index] = MaterialPool.MatFrom(new MaterialRequest()
                    this.mats[index] = AvaliMaterialPool.MatFrom(new AvaliMaterialRequest()
                    {
                        mainTex          = texture2DArray1[index],
                        shader           = req.shader,
                        color            = this.color,
                        colorTwo         = this.colorTwo,
                        colorThree       = this.colorThree,
                        maskTex          = texture2DArray2[index],
                        shaderParameters = req.shaderParameters
                    });
                }
                ;
            }
        }
Example #5
0
 // Token: 0x06001CE2 RID: 7394 RVA: 0x0001A125 File Offset: 0x00018325
 public static Material MatFrom(string texPath, Shader shader)
 {
     return(AvaliMaterialPool.MatFrom(new AvaliMaterialRequest(ContentFinder <Texture2D> .Get(texPath, true), shader)));
 }
Example #6
0
 // Token: 0x06001CDF RID: 7391 RVA: 0x0001A109 File Offset: 0x00018309
 public static Material MatFrom(Texture2D srcTex)
 {
     return(AvaliMaterialPool.MatFrom(new AvaliMaterialRequest(srcTex)));
 }