コード例 #1
0
        public override void Draw()
        {
            Material material = MaterialPool.MatFrom(this.def.graphicData.texPath, ShaderDatabase.Transparent, this.saveable.currentColor);

            material = ThingAbilityMote_Default.FadedVersionOf(material, this.saveable.exactAlpha);

            UnityEngine.Matrix4x4 matrix = default(UnityEngine.Matrix4x4);
            matrix.SetTRS(this.exactPosition, UnityEngine.Quaternion.AngleAxis(this.exactRotation, UnityEngine.Vector3.up), this.exactScale);
            UnityEngine.Graphics.DrawMesh(MeshPool.plane10, matrix, material, 0);
        }
コード例 #2
0
        public static Material FadedVersionOf(Material sourceMat, float alpha)
        {
            if (sourceMat.color == Color.white)
            {
                return(FadedMaterialPool.FadedVersionOf(sourceMat, alpha));
            }

            if (Debug.isDebugBuild && !sourceMat.HasProperty("_Color"))
            {
                return(sourceMat);
            }
            int num = ThingAbilityMote_Default.IndexFromAlpha(alpha);

            if (num == 0)
            {
                return(BaseContent.ClearMat);
            }

            Material material;

            material       = new Material(sourceMat);
            material.color = new Color(sourceMat.color.r, sourceMat.color.g, sourceMat.color.b, (float)ThingAbilityMote_Default.IndexFromAlpha(alpha) / 100f);
            return(material);
        }