예제 #1
0
        public static void ReplaceWithSpriteSheet(tk2dSpriteCollectionData data)
        {
            Texture2D spritesheet = ResourceExtractor.GetTextureFromFolder(data.name, "");

            //Texture2D[] textarray = new Texture2D[] { spritesheet};
            foreach (Material m in data.materialInsts)
            {
                m.mainTexture = spritesheet;
            }
        }
예제 #2
0
        public static void Init()
        {
            collectionsToReplace  = ResourceExtractor.GetResourceFolders();
            spriteSheetsToReplace = ResourceExtractor.GetCollectionFiles();
            foreach (string s in spriteSheetsToReplace)
            {
                ETGModConsole.Log(s);
            }
            replacedCollections = new List <tk2dSpriteCollectionData>();

            Hook hook = new Hook(typeof(tk2dSpriteCollectionData).GetMethod("Init", BindingFlags.NonPublic | BindingFlags.Instance), typeof(SpriteReplacer).GetMethod("Replace"));
        }
예제 #3
0
        public static void ReplaceWithTextures(tk2dSpriteCollectionData data)
        {
            List <Texture2D> replacements = ResourceExtractor.GetTexturesFromFolder(data.name);

            foreach (Texture2D texture in replacements)
            {
                tk2dSpriteDefinition def = GetDefinition(data, texture.name);
                if (def != null)
                {
                    def.ReplaceTexture(texture);
                }
                else
                {
                    ETGModConsole.Log("<color=#FF0000FF>" + texture.name + " not found. </color>");
                }
            }
        }