Exemplo n.º 1
0
        public static void BuildPrefab()
        {   //hatdoer
            GameObject gameObject = SpriteBuilder.SpriteFromResource("knifeJam/Resources/beard_collection/beard_right.png", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("beard");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            Beard.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("knifeJam/Resources/beard_collection/beard_left", tk2dSprite.Collection));
            Beard.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("knifeJam/Resources/beard_collection/beard_up", tk2dSprite.Collection));

            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            Beard.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(Beard.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Beard.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Beard.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");

            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            Beard.skullprefab = gameObject2;
        }
Exemplo n.º 2
0
        public static void BuildPrefab()
        {
            GameObject gameObject = SpriteBuilder.SpriteFromResource("BleakMod/Resources/winchester_hats/winchester_hat_right", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("Badaboom");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            WinchestersHat.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/winchester_hats/winchester_hat_left", tk2dSprite.Collection));
            WinchestersHat.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/winchester_hats/winchester_hat_back", tk2dSprite.Collection));
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            WinchestersHat.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            WinchestersHat.boomprefab = gameObject2;
        }
        public static void BuildPrefab()
        {           //hatdoer
            GameObject gameObject = SpriteBuilder.SpriteFromResource("Knives/Resources/RageShield", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("kinda a hat");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            Rage_shield.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("Knives/Resources/RageShield", tk2dSprite.Collection));
            Rage_shield.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("Knives/Resources/RageShield", tk2dSprite.Collection));

            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            Rage_shield.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(Rage_shield.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Rage_shield.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Rage_shield.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");

            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            Rage_shield.shieldprefab = gameObject2;
        }
Exemplo n.º 4
0
        public static void BuildPrefab()
        {
            GameObject toy = SpriteBuilder.SpriteFromResource("SpecialItemPack/Resources/RoundKing/RoundKingJump2");

            toy.SetActive(false);
            FakePrefab.MarkAsFakePrefab(toy);
            UnityEngine.Object.DontDestroyOnLoad(toy);
            GameObject rKing  = new GameObject("KingKRound");
            tk2dSprite sprite = rKing.AddComponent <tk2dSprite>();

            sprite.SetSprite(toy.GetComponent <tk2dBaseSprite>().Collection, toy.GetComponent <tk2dBaseSprite>().spriteId);
            spriteIds.Add(SpriteBuilder.AddSpriteToCollection("SpecialItemPack/Resources/RoundKing/RoundKingJump1", sprite.Collection));
            sprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            spriteIds.Add(sprite.spriteId);
            rKing.SetActive(false);
            sprite.SetSprite(spriteIds[0]);
            sprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            sprite.SetSprite(spriteIds[1]);
            FakePrefab.MarkAsFakePrefab(rKing);
            UnityEngine.Object.DontDestroyOnLoad(rKing);
            roundKingPrefab = rKing;
        }
Exemplo n.º 5
0
        public static void BuildPrefab()
        {
            GameObject pillar = SpriteBuilder.SpriteFromResource("BleakMod/Resources/kill_pillars/kali_statue_fire_002");

            pillar.SetActive(false);
            FakePrefab.MarkAsFakePrefab(pillar);
            UnityEngine.Object.DontDestroyOnLoad(pillar);
            GameObject kpillar = new GameObject("SKillPillar");
            tk2dSprite sprite  = kpillar.AddComponent <tk2dSprite>();

            sprite.SetSprite(pillar.GetComponent <tk2dBaseSprite>().Collection, pillar.GetComponent <tk2dBaseSprite>().spriteId);
            spriteIds.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/kill_pillars/kali_statue_fire_001", sprite.Collection));
            sprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            spriteIds.Add(sprite.spriteId);
            kpillar.SetActive(false);
            sprite.SetSprite(spriteIds[0]);
            sprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            sprite.SetSprite(spriteIds[1]);
            FakePrefab.MarkAsFakePrefab(kpillar);
            UnityEngine.Object.DontDestroyOnLoad(kpillar);
            killPillarPrefab = kpillar;
        }
        public static void BuildPrefab()
        {
            GameObject gameObject = SpriteBuilder.SpriteFromResource("LostItems/NuclearThrone/NuclearThroneSprite/halo_vfx_001", null, true);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("Halo");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            MutaionSpirit.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("LostItems/NuclearThrone/NuclearThroneSprite/halo_vfx_001", tk2dSprite.Collection));
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            MutaionSpirit.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(MutaionSpirit.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            //MutaionSpirit.boomprefab = gameObject2;
            prefab = gameObject2;
        }
        private static string getTk2dSpriteHashInternal(tk2dSprite tk)
        {
            var mat = tk?.GetCurrentSpriteDef()?.material;

            if (mat == null)
            {
                return("");
            }
            var tex  = mat.mainTexture;
            var dupe = tex.isReadable ? (Texture2D)tex : TextureUtils.duplicateTexture((Texture2D)mat.mainTexture);
            var hash = dupe.getHash();

            if (!tex.isReadable)
            {
                GameObject.Destroy(dupe);
            }
            return(hash);
        }
Exemplo n.º 8
0
        //Call this method from the Start() method of your ETGModule extension class
        public static void Init()
        {
            //The name of the item
            string itemName = "Rune Chalk";

            //Refers to an embedded png in the project. Make sure to embed your resources! Google it.
            string resourceName = "CakeMod/Resources/RuneChalk";

            //Create new GameObject
            GameObject obj = new GameObject(itemName);

            //Add a ActiveItem component to the object
            var item = obj.AddComponent <RuneChalk>();

            //Adds a tk2dSprite component to the object and adds your texture to the item sprite collection
            ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);

            //Ammonomicon entry variables
            string shortDesc = "Traps!";
            string longDesc  = "Rune chalk often used by amatuer gungeoneers and ammomancers alike. It can be used to draw rudimentary runes with varying effects depending on their colour.";

            //Adds the item to the gungeon item list, the ammonomicon, the loot table, etc.
            //"kts" here is the item pool. In the console you'd type kts:sweating_bullets
            ItemBuilder.SetupItem(item, shortDesc, longDesc, "cak");

            //Set the cooldown type and duration of the cooldown
            ItemBuilder.SetCooldownType(item, ItemBuilder.CooldownType.Damage, 750);
            GameObject gameObject  = SpriteBuilder.SpriteFromResource("CakeMod/Resources/RuneCircle", null, true);
            GameObject gameObject2 = new GameObject("Rune");

            tk2dSprite tk2dSprite = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);

            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            gameObject2.SetActive(false);
            RunePrefab = gameObject2;
            //Set some other fields
            item.consumable = false;
            item.quality    = ItemQuality.B;
        }
Exemplo n.º 9
0
        public static VFXPool CreateVFXPool(string name, List <string> spritePaths, int fps, IntVector2 Dimensions, tk2dBaseSprite.Anchor anchor, bool usesZHeight, float zHeightOffset, bool persist = false, VFXAlignment alignment = VFXAlignment.NormalAligned, float emissivePower = -1, Color?emissiveColour = null)
        {
            GameObject Obj  = new GameObject(name);
            VFXPool    pool = new VFXPool();

            pool.type = VFXPoolType.All;
            VFXComplex complex = new VFXComplex();
            VFXObject  vfObj   = new VFXObject();

            Obj.SetActive(false);
            FakePrefab.MarkAsFakePrefab(Obj);
            UnityEngine.Object.DontDestroyOnLoad(Obj);

            tk2dSpriteCollectionData VFXSpriteCollection = SpriteBuilder.ConstructCollection(Obj, (name + "_Collection"));
            int spriteID = SpriteBuilder.AddSpriteToCollection(spritePaths[0], VFXSpriteCollection);

            tk2dSprite sprite = Obj.GetOrAddComponent <tk2dSprite>();

            sprite.SetSprite(VFXSpriteCollection, spriteID);
            tk2dSpriteDefinition defaultDef = sprite.GetCurrentSpriteDef();

            defaultDef.colliderVertices = new Vector3[] {
                new Vector3(0f, 0f, 0f),
                new Vector3((Dimensions.x / 16), (Dimensions.y / 16), 0f)
            };

            tk2dSpriteAnimator  animator  = Obj.GetOrAddComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimation animation = Obj.GetOrAddComponent <tk2dSpriteAnimation>();

            animation.clips  = new tk2dSpriteAnimationClip[0];
            animator.Library = animation;
            tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
            {
                name = "start", frames = new tk2dSpriteAnimationFrame[0], fps = fps
            };
            List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();

            for (int i = 0; i < spritePaths.Count; i++)
            {
                tk2dSpriteCollectionData collection = VFXSpriteCollection;
                int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(spritePaths[i], collection);
                tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                frameDef.ConstructOffsetsFromAnchor(anchor);
                frameDef.colliderVertices = defaultDef.colliderVertices;
                if (emissivePower > 0)
                {
                    frameDef.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
                }
                if (emissivePower > 0)
                {
                    frameDef.material.SetFloat("_EmissiveColorPower", emissivePower);
                }
                if (emissiveColour != null)
                {
                    frameDef.material.SetColor("_EmissiveColor", (Color)emissiveColour);
                }
                if (emissivePower > 0)
                {
                    frameDef.materialInst.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
                }
                if (emissivePower > 0)
                {
                    frameDef.materialInst.SetFloat("_EmissiveColorPower", emissivePower);
                }
                if (emissiveColour != null)
                {
                    frameDef.materialInst.SetColor("_EmissiveColor", (Color)emissiveColour);
                }
                frames.Add(new tk2dSpriteAnimationFrame {
                    spriteId = frameSpriteId, spriteCollection = collection
                });
            }
            if (emissivePower > 0)
            {
                sprite.renderer.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
            }
            if (emissivePower > 0)
            {
                sprite.renderer.material.SetFloat("_EmissiveColorPower", emissivePower);
            }
            if (emissiveColour != null)
            {
                sprite.renderer.material.SetColor("_EmissiveColor", (Color)emissiveColour);
            }
            clip.frames     = frames.ToArray();
            clip.wrapMode   = tk2dSpriteAnimationClip.WrapMode.Once;
            animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
            if (!persist)
            {
                SpriteAnimatorKiller kill = animator.gameObject.AddComponent <SpriteAnimatorKiller>();
                kill.fadeTime             = -1f;
                kill.animator             = animator;
                kill.delayDestructionTime = -1f;
            }
            animator.playAutomatically = true;
            animator.DefaultClipId     = animator.GetClipIdByName("start");
            vfObj.attached             = true;
            vfObj.persistsOnDeath      = persist;
            vfObj.usesZHeight          = usesZHeight;
            vfObj.zHeight      = zHeightOffset;
            vfObj.alignment    = alignment;
            vfObj.destructible = false;
            vfObj.effect       = Obj;
            complex.effects    = new VFXObject[] { vfObj };
            pool.effects       = new VFXComplex[] { complex };
            return(pool);
        }
        public static void SetupHatSprites(List <string> spritePaths, GameObject hatObj, int fps, Vector2 hatSize)
        {
            Hat hatness = hatObj.GetComponent <Hat>();

            if (hatness)
            {
                string collectionName = hatness.hatName;
                collectionName = collectionName.Replace(" ", "_");
                tk2dSpriteCollectionData HatSpriteCollection = SpriteBuilder.ConstructCollection(hatObj, (collectionName + "_Collection"));

                int        spriteID      = SpriteBuilder.AddSpriteToCollection(spritePaths[0], HatSpriteCollection);
                tk2dSprite hatBaseSprite = hatObj.GetOrAddComponent <tk2dSprite>();
                hatBaseSprite.SetSprite(HatSpriteCollection, spriteID);
                tk2dSpriteDefinition def = hatBaseSprite.GetCurrentSpriteDef();
                def.colliderVertices = new Vector3[] {
                    new Vector3(0f, 0f, 0f),
                    new Vector3((hatSize.x / 16), (hatSize.y / 16), 0f)
                };
                hatBaseSprite.PlaceAtPositionByAnchor(hatObj.transform.position, tk2dBaseSprite.Anchor.LowerCenter);
                hatBaseSprite.depthUsesTrimmedBounds = true;
                hatBaseSprite.IsPerpendicular        = true;
                hatBaseSprite.UpdateZDepth();
                hatBaseSprite.HeightOffGround = 0.2f;

                List <string> SouthAnimation     = new List <string>();
                List <string> NorthAnimation     = new List <string>();
                List <string> EastAnimation      = new List <string>();
                List <string> WestAnimation      = new List <string>();
                List <string> NorthWestAnimation = new List <string>();
                List <string> NorthEastAnimation = new List <string>();
                List <string> SouthEastAnimation = new List <string>();
                List <string> SouthWestAnimation = new List <string>();

                switch (hatness.hatDirectionality)
                {
                case Hat.HatDirectionality.EIGHTWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northwest_"))
                        {
                            NorthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northeast_"))
                        {
                            NorthEastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_southwest_"))
                        {
                            SouthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_southeast_"))
                        {
                            SouthEastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.SIXWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northwest_"))
                        {
                            NorthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northeast_"))
                        {
                            NorthEastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.FOURWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.TWOWAYHORIZONTAL:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.TWOWAYVERTICAL:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.NONE:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;
                }

                //SET UP THE ANIMATOR AND THE ANIMATION
                tk2dSpriteAnimator  animator  = hatObj.GetOrAddComponent <tk2dSpriteAnimator>();
                tk2dSpriteAnimation animation = hatObj.GetOrAddComponent <tk2dSpriteAnimation>();
                animation.clips  = new tk2dSpriteAnimationClip[0];
                animator.Library = animation;

                //SOUTH ANIMATION
                if (SouthAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_south", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTH ANIMATIONS
                if (NorthAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_north", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //WEST ANIMATIONS
                if (WestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_west", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in WestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //EAST ANIMATIONS
                if (EastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_east", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in EastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTHEAST
                if (NorthEastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_northeast", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthEastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTHWEST ANIMATION
                if (NorthWestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_northwest", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthWestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //SOUTHWEST ANIMATION
                if (SouthWestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_southwest", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthWestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //SOUTHEAST ANIMATION
                if (SouthEastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_southeast", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthEastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
            }
        }