예제 #1
0
        /// <summary>
        /// Returns an object with a tk2dSprite component with the
        /// texture of a file in the sprites folder
        /// </summary>
        public static GameObject SpriteFromFile(string spriteName, GameObject obj = null, bool copyFromExisting = true)
        {
            string filename = spriteName.Replace(".png", "");

            var texture = ResourceExtractor.GetTextureFromFile(filename);

            if (texture == null)
            {
                return(null);
            }

            return(SpriteFromTexture(texture, spriteName, obj, copyFromExisting));
        }
예제 #2
0
        /// <summary>
        /// Returns an object with a tk2dSprite component with the
        /// texture of a file in the sprites folder
        /// </summary>
        public static GameObject SpriteFromFile(string spriteName)
        {
            string filename = spriteName.Replace(".png", "");

            var texture = ResourceExtractor.GetTextureFromFile(filename);

            if (texture == null)
            {
                return(null);
            }

            return(SpriteFromTexture(texture, spriteName));
        }
예제 #3
0
        // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
        public static GameObject SpriteFromFile(string spriteName, GameObject obj = null, bool copyFromExisting = true)
        {
            string     fileName        = spriteName.Replace(".png", "");
            Texture2D  textureFromFile = ResourceExtractor.GetTextureFromFile(fileName, ".png");
            bool       flag            = textureFromFile == null;
            GameObject result;

            if (flag)
            {
                result = null;
            }
            else
            {
                result = SpriteBuilder.SpriteFromTexture(textureFromFile, spriteName, obj, copyFromExisting);
            }
            return(result);
        }