Пример #1
0
        /// <summary>
        /// Get a texture from resources with modding support.
        /// Size is read from xml or set as texture size.
        /// </summary>
        public static Texture2D GetTextureFromResources(string name, out Vector2 size)
        {
            Texture2D tex = GetTextureFromResources(name);

            if (!TextureReplacement.TryGetSize(name, out size))
            {
                size = new Vector2(tex.width, tex.height);
            }
            return(tex);
        }