Пример #1
0
        /// <summary>
        /// Caches a single pixel texture of any color and always returns the texture cached.
        /// </summary>
        public static Texture2D CacheTexture(this Color color)
        {
            if (coloredTextures.ContainsKey(color))
            {
                if (coloredTextures[color] == null)
                {
                    coloredTextures[color] = HUMTexture.Create(1, 1).Color(color);
                }
            }
            else
            {
                coloredTextures.Add(color, HUMTexture.Create(1, 1).Color(color));
            }

            return(coloredTextures[color]);
        }
 /// <summary>
 /// Colors a newly created texture.
 /// </summary>
 public static Texture2D Color(this HUMTexture.Data.Create texture, Color color)
 {
     return(HUMTexture.Color(texture.texture, color));
 }