Exemple #1
0
        public static void Init()
        {
            string     itemName     = "Lich's Book";
            string     resourceName = "LichItems/Resources/lichsbook_item_001";
            GameObject obj          = new GameObject(itemName);
            var        item         = obj.AddComponent <LichsBookItem>();

            ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);
            string shortDesc = "Bang Bang Bang";
            string longDesc  = "A book about the know-how of shooting skills and knowledge of magic.\nThe book itself has magical power, Just unfolding it has a mysterious effect.";

            ItemBuilder.SetupItem(item, shortDesc, longDesc, "spapi");
            ItemBuilder.SetCooldownType(item, ItemBuilder.CooldownType.Damage, 600);
            item.consumable = false;
            item.quality    = ItemQuality.C;
            Game.Items.Rename("spapi:lich's_book", "spapi:lichs_book");
            GameObject shadow = SpriteBuilder.SpriteFromResource("LichItems/Resources/lichsbook_shadow_001");

            shadow.SetActive(false);
            FakePrefab.MarkAsFakePrefab(shadow);
            DontDestroyOnLoad(shadow);
            tk2dBaseSprite sprite = shadow.GetComponent <tk2dBaseSprite>();

            ConstructOffsetsFromAnchor(sprite.GetCurrentSpriteDef(), tk2dBaseSprite.Anchor.LowerCenter);
            Shader shadowShader = GameManager.Instance.RewardManager.A_Chest.gameObject.transform.Find("Shadow").gameObject.GetComponent <tk2dSprite>().renderer.material.shader;

            sprite.GetCurrentSpriteDef().material.shader = shadowShader;
            sprite.GetCurrentSpriteDef().materialInst.shader = shadowShader;
            GameObject book = SpriteBuilder.SpriteFromResource("LichItems/Resources/lichsbook_depoy_001");

            book.SetActive(false);
            FakePrefab.MarkAsFakePrefab(book);
            DontDestroyOnLoad(book);
            tk2dSpriteAnimator animator = book.gameObject.AddComponent <tk2dSpriteAnimator>();
            List <int>         ids      = new List <int>
            {
                book.GetComponent <tk2dBaseSprite>().spriteId,
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_002", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_003", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_004", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_005", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_006", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_007", book.GetComponent <tk2dBaseSprite>().Collection),
                SpriteBuilder.AddSpriteToCollection("LichItems/Resources/lichsbook_depoy_008", book.GetComponent <tk2dBaseSprite>().Collection),
            };

            foreach (int id in ids)
            {
                ConstructOffsetsFromAnchor(book.GetComponent <tk2dBaseSprite>().Collection.spriteDefinitions[id], tk2dBaseSprite.Anchor.LowerCenter);
            }
            SpriteBuilder.AddAnimation(animator, book.GetComponent <tk2dBaseSprite>().Collection, ids, "idle", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 10;
            animator.DefaultClipId     = animator.GetClipIdByName("idle");
            animator.playAutomatically = true;
            book.AddComponent <LichsBook>().shadowPrefab = shadow;
            item.LichsBookPrefab = book;
            BuildLibrary(item);
        }
Exemple #2
0
        public static void Initialise()
        {
            lockdownVFXObject = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/lockdown_effect_icon", new GameObject("LockdownIcon"));
            lockdownVFXObject.SetActive(false);
            tk2dBaseSprite vfxSprite = lockdownVFXObject.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(lockdownVFXObject);
            UnityEngine.Object.DontDestroyOnLoad(lockdownVFXObject);

            /*tk2dSpriteAnimator animator = lockdownVFXObject.AddComponent<tk2dSpriteAnimator>();
             * animator.Library = lockdownVFXObject.AddComponent<tk2dSpriteAnimation>();
             * animator.Library.clips = new tk2dSpriteAnimationClip[0];
             *
             * tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip { name = "LockdownIconClip", fps = 5, frames = new tk2dSpriteAnimationFrame[0] };
             * foreach (string path in LockdownPaths)
             * {
             *  int spriteId = SpriteBuilder.AddSpriteToCollection(path, lockdownVFXObject.GetComponent<tk2dBaseSprite>().Collection);
             *  tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = spriteId, spriteCollection = lockdownVFXObject.GetComponent<tk2dBaseSprite>().Collection };
             *  clip.frames = clip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
             * }
             * animator.Library.clips = animator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
             * animator.playAutomatically = true;
             * animator.DefaultClipId = animator.GetClipIdByName("LockdownIconClip");*/
        }
        public static void BuildIcon()
        {
            TeleportIcon = SpriteBuilder.SpriteFromResource("BleakMod/Resources/phase_shift_vfx/phase_shift_vfx_idle_001");
            tk2dBaseSprite vfxSprite = TeleportIcon.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(TeleportIcon);
            UnityEngine.Object.DontDestroyOnLoad(TeleportIcon);
            TeleportIcon.SetActive(false);
            List <string> vfxIdleSprites = new List <string>
            {
                "phase_shift_vfx_idle_001.png",
                "phase_shift_vfx_idle_002.png",
                "phase_shift_vfx_idle_003.png",
                "phase_shift_vfx_idle_004.png",
                "phase_shift_vfx_idle_005.png",
                "phase_shift_vfx_idle_006.png",
                "phase_shift_vfx_idle_007.png",
                "phase_shift_vfx_idle_008.png"
            };

            var collection  = TeleportIcon.GetComponent <tk2dSprite>().Collection;
            var idleIdsList = new List <int>();

            foreach (string sprite in vfxIdleSprites)
            {
                idleIdsList.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/phase_shift_vfx/" + sprite, collection));
            }
            tk2dSpriteAnimator spriteAnimator = TeleportIcon.AddComponent <tk2dSpriteAnimator>();

            spriteAnimator.playAutomatically = true;
            SpriteBuilder.AddAnimation(spriteAnimator, collection, idleIdsList, "phase_shift_vfx_idle", tk2dSpriteAnimationClip.WrapMode.Loop, 8);
        }
Exemple #4
0
        public static void Init()
        {
            money2VFXObject = SpriteBuilder.SpriteFromResource("CakeMod/Resources/money22Debuff", new GameObject("money22Icon"));
            money2VFXObject.SetActive(false);
            tk2dBaseSprite vfxSprite = money2VFXObject.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(money2VFXObject);
            UnityEngine.Object.DontDestroyOnLoad(money2VFXObject);
        }
Exemple #5
0
        public static void BuildPrefab()
        {
            LimeVFXObject = SpriteBuilder.SpriteFromResource("CakeMod/Resources/Lime", new GameObject("FrailtyIcon"));
            LimeVFXObject.SetActive(false);
            tk2dBaseSprite vfxSprite = LimeVFXObject.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(LimeVFXObject);
            UnityEngine.Object.DontDestroyOnLoad(LimeVFXObject);
        }
        public static void Init()
        {
            string     itemName     = "Lead Soul";
            string     resourceName = "NevernamedsItems/Resources/leadsoul_icon";
            GameObject obj          = new GameObject(itemName);
            var        item         = obj.AddComponent <LeadSoul>();

            ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);
            string shortDesc = "No Voice To Cry Suffering";
            string longDesc  = "Grants a regenerating shield." + "\n\nSteel yourself against the tribulations ahead, for the world is dark and cold...";

            ItemBuilder.SetupItem(item, shortDesc, longDesc, "nn");
            item.quality = PickupObject.ItemQuality.S;
            LeadSoulID   = item.PickupObjectId;
            item.SetupUnlockOnCustomFlag(CustomDungeonFlags.LICH_BEATEN_SHADE, true);

            #region VFXSetup
            GameObject plagueVFXObject = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/MiscVFX/LeadSoulVFX/leadsouloverhead_001", new GameObject("LeadSoulOverhead"));
            plagueVFXObject.SetActive(false);
            tk2dBaseSprite plaguevfxSprite = plagueVFXObject.GetOrAddComponent <tk2dBaseSprite>();
            plaguevfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, plaguevfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(plagueVFXObject);
            UnityEngine.Object.DontDestroyOnLoad(plagueVFXObject);
            //Animating the overhead
            tk2dSpriteAnimator plagueanimator = plagueVFXObject.AddComponent <tk2dSpriteAnimator>();
            plagueanimator.Library       = plagueVFXObject.AddComponent <tk2dSpriteAnimation>();
            plagueanimator.Library.clips = new tk2dSpriteAnimationClip[0];

            tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip {
                name = "LeadSoulOverheadClip", fps = 10, frames = new tk2dSpriteAnimationFrame[0]
            };
            foreach (string path in OverheadVFXPaths)
            {
                int spriteId = SpriteBuilder.AddSpriteToCollection(path, plagueVFXObject.GetComponent <tk2dBaseSprite>().Collection);

                plagueVFXObject.GetComponent <tk2dBaseSprite>().Collection.spriteDefinitions[spriteId].ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);

                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = spriteId, spriteCollection = plagueVFXObject.GetComponent <tk2dBaseSprite>().Collection
                };
                clip.frames = clip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }

            plagueanimator.Library.clips     = plagueanimator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
            plagueanimator.playAutomatically = true;
            plagueanimator.DefaultClipId     = plagueanimator.GetClipIdByName("LeadSoulOverheadClip");
            VFXPrefab = plagueVFXObject;
            #endregion
        }
        private static void BuildTarget()
        {
            targetPrefab = SpriteBuilder.SpriteFromResource("BleakMod/Resources/winchester_targets/winchester_target_001");
            tk2dBaseSprite vfxSprite = targetPrefab.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(targetPrefab);
            UnityEngine.Object.DontDestroyOnLoad(targetPrefab);
            targetPrefab.SetActive(false);
            List <string> vfxIdleSprites = new List <string>
            {
                "winchester_target_001.png",
                "winchester_target_002.png",
                "winchester_target_003.png",
                "winchester_target_004.png",
                "winchester_target_005.png",
                "winchester_target_006.png",
                "winchester_target_007.png",
                "winchester_target_008.png",
                "winchester_target_009.png",
                "winchester_target_010.png",
                "winchester_target_011.png",
                "winchester_target_012.png",
                "winchester_target_013.png",
                "winchester_target_014.png",
            };

            var collection  = targetPrefab.GetComponent <tk2dSprite>().Collection;
            var idleIdsList = new List <int>();

            foreach (string sprite in vfxIdleSprites)
            {
                idleIdsList.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/winchester_targets/" + sprite, collection));
            }
            tk2dSpriteAnimator spriteAnimator = targetPrefab.AddComponent <tk2dSpriteAnimator>();

            spriteAnimator.playAutomatically = true;
            SpriteBuilder.AddAnimation(spriteAnimator, collection, idleIdsList, "winchetser_target_idle", tk2dSpriteAnimationClip.WrapMode.Loop, 7);
            var body = targetPrefab.GetComponent <tk2dSprite>().SetUpSpeculativeRigidbody(IntVector2.Zero, new IntVector2(20, 23));            //Numbers at the end are the dimensions of the hitbox

            body.CollideWithTileMap = false;
            body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.BulletBlocker;
        }
Exemple #8
0
        public static GameObject CreateOverheadVFX(List <string> filepaths, string name, int fps)
        {
            //Setting up the Overhead Plague VFX
            GameObject overheadderVFX = SpriteBuilder.SpriteFromResource(filepaths[0], new GameObject(name));

            overheadderVFX.SetActive(false);
            tk2dBaseSprite plaguevfxSprite = overheadderVFX.GetComponent <tk2dBaseSprite>();

            plaguevfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, plaguevfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(overheadderVFX);
            UnityEngine.Object.DontDestroyOnLoad(overheadderVFX);

            //Animating the overhead
            tk2dSpriteAnimator plagueanimator = overheadderVFX.AddComponent <tk2dSpriteAnimator>();

            plagueanimator.Library       = overheadderVFX.AddComponent <tk2dSpriteAnimation>();
            plagueanimator.Library.clips = new tk2dSpriteAnimationClip[0];

            tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip {
                name = "NewOverheadVFX", fps = fps, frames = new tk2dSpriteAnimationFrame[0]
            };

            foreach (string path in filepaths)
            {
                int spriteId = SpriteBuilder.AddSpriteToCollection(path, overheadderVFX.GetComponent <tk2dBaseSprite>().Collection);

                overheadderVFX.GetComponent <tk2dBaseSprite>().Collection.spriteDefinitions[spriteId].ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);

                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = spriteId, spriteCollection = overheadderVFX.GetComponent <tk2dBaseSprite>().Collection
                };
                clip.frames = clip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            plagueanimator.Library.clips     = plagueanimator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
            plagueanimator.playAutomatically = true;
            plagueanimator.DefaultClipId     = plagueanimator.GetClipIdByName("NewOverheadVFX");
            return(overheadderVFX);
        }
    protected void DrawSpriteEditorGUI()
    {
        Event ev = Event.current;

        tk2dSpriteGuiUtility.SpriteSelector(targetSprites[0].Collection, targetSprites[0].spriteId, spriteChangedCallbackInstance, null);

        if (targetSprites[0].Collection != null)
        {
            if (tk2dPreferences.inst.displayTextureThumbs)
            {
                tk2dBaseSprite       sprite = targetSprites[0];
                tk2dSpriteDefinition def    = sprite.GetCurrentSpriteDef();
                if (sprite.Collection.version < 1 || def.texelSize == Vector2.zero)
                {
                    string message = "";

                    message = "No thumbnail data.";
                    if (sprite.Collection.version < 1)
                    {
                        message += "\nPlease rebuild Sprite Collection.";
                    }

                    tk2dGuiUtility.InfoBox(message, tk2dGuiUtility.WarningLevel.Info);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel(" ");

                    int  tileSize = 128;
                    Rect r        = GUILayoutUtility.GetRect(tileSize, tileSize, GUILayout.ExpandWidth(false));
                    tk2dGrid.Draw(r);
                    tk2dSpriteThumbnailCache.DrawSpriteTextureInRect(r, def, Color.white);

                    GUILayout.EndHorizontal();

                    r = GUILayoutUtility.GetLastRect();
                    if (ev.type == EventType.MouseDown && ev.button == 0 && r.Contains(ev.mousePosition))
                    {
                        tk2dSpriteGuiUtility.SpriteSelectorPopup(sprite.Collection, sprite.spriteId, spriteChangedCallbackInstance, null);
                    }
                }
            }

            Color newColor = EditorGUILayout.ColorField("Color", targetSprites[0].color);
            if (newColor != targetSprites[0].color)
            {
                tk2dUndo.RecordObjects(targetSprites, "Sprite Color");
                foreach (tk2dBaseSprite s in targetSprites)
                {
                    s.color = newColor;
                }
            }

            GUILayout.Space(8);
#if UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2
            int sortingOrder = EditorGUILayout.IntField("Sorting Order In Layer", targetSprites[0].SortingOrder);
            if (sortingOrder != targetSprites[0].SortingOrder)
            {
                tk2dUndo.RecordObjects(targetSprites, "Sorting Order In Layer");
                foreach (tk2dBaseSprite s in targetSprites)
                {
                    s.SortingOrder = sortingOrder;
                }
            }
#else
            if (renderers.Length > 0)
            {
                string sortingLayerName = tk2dEditorUtility.SortingLayerNamePopup("Sorting Layer", renderers[0].sortingLayerName);
                if (sortingLayerName != renderers[0].sortingLayerName)
                {
                    tk2dUndo.RecordObjects(renderers, "Sorting Layer");
                    foreach (Renderer r in renderers)
                    {
                        r.sortingLayerName = sortingLayerName;
                    }
                }

                int sortingOrder = EditorGUILayout.IntField("Order In Layer", targetSprites[0].SortingOrder);
                if (sortingOrder != targetSprites[0].SortingOrder)
                {
                    tk2dUndo.RecordObjects(targetSprites, "Order In Layer");
                    tk2dUndo.RecordObjects(renderers, "Order In Layer");
                    foreach (tk2dBaseSprite s in targetSprites)
                    {
                        s.SortingOrder = sortingOrder;
                    }
                }
            }
#endif
            GUILayout.Space(8);


            Vector3 newScale = EditorGUILayout.Vector3Field("Scale", targetSprites[0].scale);
            if (newScale != targetSprites[0].scale)
            {
                tk2dUndo.RecordObjects(targetSprites, "Sprite Scale");
                foreach (tk2dBaseSprite s in targetSprites)
                {
                    s.scale = newScale;
                    s.EditMode__CreateCollider();
                }
            }

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("HFlip", EditorStyles.miniButton))
            {
                tk2dUndo.RecordObjects(targetSprites, "Sprite HFlip");
                foreach (tk2dBaseSprite sprite in targetSprites)
                {
                    sprite.EditMode__CreateCollider();
                    Vector3 scale = sprite.scale;
                    scale.x     *= -1.0f;
                    sprite.scale = scale;
                }
                GUI.changed = true;
            }
            if (GUILayout.Button("VFlip", EditorStyles.miniButton))
            {
                tk2dUndo.RecordObjects(targetSprites, "Sprite VFlip");
                foreach (tk2dBaseSprite sprite in targetSprites)
                {
                    Vector3 s = sprite.scale;
                    s.y         *= -1.0f;
                    sprite.scale = s;
                    GUI.changed  = true;
                }
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(new GUIContent("Reset Scale", "Set scale to 1"), EditorStyles.miniButton))
            {
                tk2dUndo.RecordObjects(targetSprites, "Sprite Reset Scale");
                foreach (tk2dBaseSprite sprite in targetSprites)
                {
                    Vector3 s = sprite.scale;
                    s.x          = Mathf.Sign(s.x);
                    s.y          = Mathf.Sign(s.y);
                    s.z          = Mathf.Sign(s.z);
                    sprite.scale = s;
                    GUI.changed  = true;
                }
            }

            if (GUILayout.Button(new GUIContent("Bake Scale", "Transfer scale from transform.scale -> sprite"), EditorStyles.miniButton))
            {
                foreach (tk2dBaseSprite sprite in targetSprites)
                {
                    tk2dScaleUtility.Bake(sprite.transform);
                }
                GUI.changed = true;
            }

            GUIContent pixelPerfectButton = new GUIContent("1:1", "Make Pixel Perfect for camera");
            if (GUILayout.Button(pixelPerfectButton, EditorStyles.miniButton))
            {
                if (tk2dPixelPerfectHelper.inst)
                {
                    tk2dPixelPerfectHelper.inst.Setup();
                }
                tk2dUndo.RecordObjects(targetSprites, "Sprite Pixel Perfect");
                foreach (tk2dBaseSprite sprite in targetSprites)
                {
                    sprite.MakePixelPerfect();
                }
                GUI.changed = true;
            }

            EditorGUILayout.EndHorizontal();
        }
        else
        {
            tk2dGuiUtility.InfoBox("Please select a sprite collection.", tk2dGuiUtility.WarningLevel.Error);
        }


        bool needUpdatePrefabs = false;
        if (GUI.changed)
        {
            foreach (tk2dBaseSprite sprite in targetSprites)
            {
                if (PrefabUtility.GetPrefabAssetType(sprite) == PrefabAssetType.Regular)
                {
                    needUpdatePrefabs = true;
                }
                tk2dUtil.SetDirty(sprite);
            }
        }

        // This is a prefab, and changes need to be propagated. This isn't supported in Unity 3.4
        if (needUpdatePrefabs)
        {
            // Rebuild prefab instances
            tk2dBaseSprite[] allSprites = Resources.FindObjectsOfTypeAll(typeof(tk2dBaseSprite)) as tk2dBaseSprite[];
            foreach (var spr in allSprites)
            {
                if (PrefabUtility.GetPrefabInstanceStatus(spr) == PrefabInstanceStatus.Connected)
                {
                    Object parent = PrefabUtility.GetCorrespondingObjectFromSource(spr.gameObject);
                    bool   found  = false;
                    foreach (tk2dBaseSprite sprite in targetSprites)
                    {
                        if (sprite.gameObject == parent)
                        {
                            found = true;
                            break;
                        }
                    }

                    if (found)
                    {
                        // Reset all prefab states
                        var propMod = PrefabUtility.GetPropertyModifications(spr);
                        PrefabUtility.RevertObjectOverride(spr, InteractionMode.AutomatedAction);
                        PrefabUtility.SetPropertyModifications(spr, propMod);

                        spr.ForceBuild();
                    }
                }
            }
        }
    }
    protected void DrawSpriteEditorGUI(tk2dBaseSprite sprite)
    {
        var newCollection = tk2dSpriteGuiUtility.SpriteCollectionPopup("Collection", sprite.Collection, true, sprite.spriteId);
        if (sprite.Collection != newCollection)
        {
            if (sprite.Collection == null)
                sprite.Collection = newCollection;

            int spriteId = sprite.spriteId;
            if (sprite.spriteId < 0 || sprite.spriteId >= sprite.Collection.Count
                || !sprite.Collection.inst.spriteDefinitions[sprite.spriteId].Valid)
                spriteId = sprite.Collection.FirstValidDefinitionIndex;
            sprite.SwitchCollectionAndSprite(newCollection, spriteId);
            sprite.ForceBuild();
        }

        if (sprite.Collection)
        {
            int newSpriteId = sprite.spriteId;

            // sanity check sprite id
            if (sprite.spriteId < 0 || sprite.spriteId >= sprite.Collection.Count
                || !sprite.Collection.inst.spriteDefinitions[sprite.spriteId].Valid)
            {
                newSpriteId = sprite.Collection.inst.FirstValidDefinitionIndex;
            }

            newSpriteId = tk2dSpriteGuiUtility.SpriteSelectorPopup("Sprite", sprite.spriteId, sprite.Collection);
            if (tk2dPreferences.inst.displayTextureThumbs)
            {
                tk2dSpriteDefinition def = sprite.GetCurrentSpriteDef();
                if (sprite.Collection.version < 1 || def.texelSize == Vector2.zero)
                {
                    string message = "";

                    message = "No thumbnail data.";
                    if (sprite.Collection.version < 1)
                        message += "\nPlease rebuild Sprite Collection.";

                    tk2dGuiUtility.InfoBox(message, tk2dGuiUtility.WarningLevel.Info);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel(" ");

                    Vector2 texSize = thumbnailCache.GetSpriteSizePixels(def);
                    float w = texSize.x;
                    float h = texSize.y;
                    float maxSize = 128.0f;
                    if (w > maxSize)
                    {
                        h = h / w * maxSize;
                        w = maxSize;
                    }

                    Rect r = GUILayoutUtility.GetRect(w, h, GUILayout.ExpandWidth(false));
                    thumbnailCache.DrawSpriteTexture(r, def);

                    GUILayout.EndHorizontal();
                }
            }

            if (newSpriteId != sprite.spriteId)
            {
                sprite.spriteId = newSpriteId;
                sprite.EditMode__CreateCollider();
                GUI.changed = true;
            }

            sprite.color = EditorGUILayout.ColorField("Color", sprite.color);
            Vector3 newScale = EditorGUILayout.Vector3Field("Scale", sprite.scale);
            if (newScale != sprite.scale)
            {
                sprite.scale = newScale;
                sprite.EditMode__CreateCollider();
            }

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("HFlip"))
            {
                Vector3 s = sprite.scale;
                s.x *= -1.0f;
                sprite.scale = s;
                GUI.changed = true;
            }
            if (GUILayout.Button("VFlip"))
            {
                Vector3 s = sprite.scale;
                s.y *= -1.0f;
                sprite.scale = s;
                GUI.changed = true;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(new GUIContent("Reset Scale", "Set scale to 1")))
            {
                Vector3 s = sprite.scale;
                s.x = Mathf.Sign(s.x);
                s.y = Mathf.Sign(s.y);
                s.z = Mathf.Sign(s.z);
                sprite.scale = s;
                GUI.changed = true;
            }

            if (GUILayout.Button(new GUIContent("Bake Scale", "Transfer scale from transform.scale -> sprite")))
            {
                tk2dScaleUtility.Bake(sprite.transform);
                GUI.changed = true;
            }

            GUIContent pixelPerfectButton = new GUIContent("1:1", "Make Pixel Perfect");
            if ( GUILayout.Button(pixelPerfectButton ))
            {
                if (tk2dPixelPerfectHelper.inst) tk2dPixelPerfectHelper.inst.Setup();
                sprite.MakePixelPerfect();
                GUI.changed = true;
            }

            sprite.pixelPerfect = GUILayout.Toggle(sprite.pixelPerfect, new GUIContent("Always", "Always keep pixel perfect"), GUILayout.Width(60.0f));
            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.IntSlider("Need a collection bound", 0, 0, 1);
        }

        bool needUpdatePrefabs = false;
        if (GUI.changed)
        {
            EditorUtility.SetDirty(sprite);
        #if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            if (PrefabUtility.GetPrefabType(sprite) == PrefabType.Prefab)
                needUpdatePrefabs = true;
        #endif
        }

        // This is a prefab, and changes need to be propagated. This isn't supported in Unity 3.4
        if (needUpdatePrefabs)
        {
        #if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            // Rebuild prefab instances
            tk2dBaseSprite[] allSprites = Resources.FindObjectsOfTypeAll(sprite.GetType()) as tk2dBaseSprite[];
            foreach (var spr in allSprites)
            {
                if (PrefabUtility.GetPrefabType(spr) == PrefabType.PrefabInstance &&
                    PrefabUtility.GetPrefabParent(spr.gameObject) == sprite.gameObject)
                {
                    // Reset all prefab states
                    var propMod = PrefabUtility.GetPropertyModifications(spr);
                    PrefabUtility.ResetToPrefabState(spr);
                    PrefabUtility.SetPropertyModifications(spr, propMod);

                    spr.ForceBuild();
                }
            }
        #endif
        }
    }
    protected void DrawSpriteEditorGUI(tk2dBaseSprite sprite)
    {
        Event ev = Event.current;
        tk2dSpriteGuiUtility.SpriteSelector( sprite.Collection, sprite.spriteId, spriteChangedCallbackInstance, null );

        if (sprite.Collection != null)
        {
            if (tk2dPreferences.inst.displayTextureThumbs) {
                tk2dSpriteDefinition def = sprite.GetCurrentSpriteDef();
                if (sprite.Collection.version < 1 || def.texelSize == Vector2.zero)
                {
                    string message = "";

                    message = "No thumbnail data.";
                    if (sprite.Collection.version < 1)
                        message += "\nPlease rebuild Sprite Collection.";

                    tk2dGuiUtility.InfoBox(message, tk2dGuiUtility.WarningLevel.Info);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel(" ");

                    int tileSize = 128;
                    Rect r = GUILayoutUtility.GetRect(tileSize, tileSize, GUILayout.ExpandWidth(false));
                    tk2dGrid.Draw(r);
                    thumbnailCache.DrawSpriteTextureInRect(r, def, Color.white);

                    GUILayout.EndHorizontal();

                    r = GUILayoutUtility.GetLastRect();
                    if (ev.type == EventType.MouseDown && ev.button == 0 && r.Contains(ev.mousePosition)) {
                        tk2dSpriteGuiUtility.SpriteSelectorPopup( sprite.Collection, sprite.spriteId, spriteChangedCallbackInstance, null );
                    }
                }
            }

            sprite.color = EditorGUILayout.ColorField("Color", sprite.color);
            Vector3 newScale = EditorGUILayout.Vector3Field("Scale", sprite.scale);
            if (newScale != sprite.scale)
            {
                sprite.scale = newScale;
                sprite.EditMode__CreateCollider();
            }

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("HFlip"))
            {
                Vector3 s = sprite.scale;
                s.x *= -1.0f;
                sprite.scale = s;
                GUI.changed = true;
            }
            if (GUILayout.Button("VFlip"))
            {
                Vector3 s = sprite.scale;
                s.y *= -1.0f;
                sprite.scale = s;
                GUI.changed = true;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(new GUIContent("Reset Scale", "Set scale to 1")))
            {
                Vector3 s = sprite.scale;
                s.x = Mathf.Sign(s.x);
                s.y = Mathf.Sign(s.y);
                s.z = Mathf.Sign(s.z);
                sprite.scale = s;
                GUI.changed = true;
            }

            if (GUILayout.Button(new GUIContent("Bake Scale", "Transfer scale from transform.scale -> sprite")))
            {
                tk2dScaleUtility.Bake(sprite.transform);
                GUI.changed = true;
            }

            GUIContent pixelPerfectButton = new GUIContent("1:1", "Make Pixel Perfect");
            if ( GUILayout.Button(pixelPerfectButton ))
            {
                if (tk2dPixelPerfectHelper.inst) tk2dPixelPerfectHelper.inst.Setup();
                sprite.MakePixelPerfect();
                GUI.changed = true;
            }

            sprite.pixelPerfect = GUILayout.Toggle(sprite.pixelPerfect, new GUIContent("Always", "Always keep pixel perfect"), GUILayout.Width(60.0f));
            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.IntSlider("Need a collection bound", 0, 0, 1);
        }

        bool needUpdatePrefabs = false;
        if (GUI.changed)
        {
            EditorUtility.SetDirty(sprite);
        #if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            if (PrefabUtility.GetPrefabType(sprite) == PrefabType.Prefab)
                needUpdatePrefabs = true;
        #endif
        }

        // This is a prefab, and changes need to be propagated. This isn't supported in Unity 3.4
        if (needUpdatePrefabs)
        {
        #if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            // Rebuild prefab instances
            tk2dBaseSprite[] allSprites = Resources.FindObjectsOfTypeAll(sprite.GetType()) as tk2dBaseSprite[];
            foreach (var spr in allSprites)
            {
                if (PrefabUtility.GetPrefabType(spr) == PrefabType.PrefabInstance &&
                    PrefabUtility.GetPrefabParent(spr.gameObject) == sprite.gameObject)
                {
                    // Reset all prefab states
                    var propMod = PrefabUtility.GetPropertyModifications(spr);
                    PrefabUtility.ResetToPrefabState(spr);
                    PrefabUtility.SetPropertyModifications(spr, propMod);

                    spr.ForceBuild();
                }
            }
        #endif
        }
    }
    protected void DrawSpriteEditorGUI(tk2dBaseSprite sprite)
    {
        var newCollection = tk2dSpriteGuiUtility.SpriteCollectionPopup("Collection", sprite.Collection, true, sprite.spriteId);

        if (sprite.Collection != newCollection)
        {
            if (sprite.Collection == null)
            {
                sprite.Collection = newCollection;
            }

            int spriteId = sprite.spriteId;
            if (sprite.spriteId < 0 || sprite.spriteId >= sprite.Collection.Count ||
                !sprite.Collection.inst.spriteDefinitions[sprite.spriteId].Valid)
            {
                spriteId = sprite.Collection.FirstValidDefinitionIndex;
            }
            sprite.SwitchCollectionAndSprite(newCollection, spriteId);
            sprite.ForceBuild();
        }

        if (sprite.Collection)
        {
            int newSpriteId = sprite.spriteId;

            // sanity check sprite id
            if (sprite.spriteId < 0 || sprite.spriteId >= sprite.Collection.Count ||
                !sprite.Collection.inst.spriteDefinitions[sprite.spriteId].Valid)
            {
                newSpriteId = sprite.Collection.inst.FirstValidDefinitionIndex;
            }

            newSpriteId = tk2dSpriteGuiUtility.SpriteSelectorPopup("Sprite", sprite.spriteId, sprite.Collection);
            if (tk2dPreferences.inst.displayTextureThumbs)
            {
                tk2dSpriteDefinition def = sprite.GetCurrentSpriteDef();
                if (sprite.Collection.version < 1 || def.texelSize == Vector2.zero)
                {
                    string message = "";

                    message = "No thumbnail data.";
                    if (sprite.Collection.version < 1)
                    {
                        message += "\nPlease rebuild Sprite Collection.";
                    }

                    tk2dGuiUtility.InfoBox(message, tk2dGuiUtility.WarningLevel.Info);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel(" ");

                    Vector2 texSize = thumbnailCache.GetSpriteSizePixels(def);
                    float   w       = texSize.x;
                    float   h       = texSize.y;
                    float   maxSize = 128.0f;
                    if (w > maxSize)
                    {
                        h = h / w * maxSize;
                        w = maxSize;
                    }

                    Rect r = GUILayoutUtility.GetRect(w, h, GUILayout.ExpandWidth(false));
                    thumbnailCache.DrawSpriteTexture(r, def);

                    GUILayout.EndHorizontal();
                }
            }

            if (newSpriteId != sprite.spriteId)
            {
                sprite.spriteId = newSpriteId;
                sprite.EditMode__CreateCollider();
                GUI.changed = true;
            }

            sprite.color = EditorGUILayout.ColorField("Color", sprite.color);
            Vector3 newScale = EditorGUILayout.Vector3Field("Scale", sprite.scale);
            if (newScale != sprite.scale)
            {
                sprite.scale = newScale;
                sprite.EditMode__CreateCollider();
            }

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("HFlip"))
            {
                Vector3 s = sprite.scale;
                s.x         *= -1.0f;
                sprite.scale = s;
                GUI.changed  = true;
            }
            if (GUILayout.Button("VFlip"))
            {
                Vector3 s = sprite.scale;
                s.y         *= -1.0f;
                sprite.scale = s;
                GUI.changed  = true;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(new GUIContent("Reset Scale", "Set scale to 1")))
            {
                Vector3 s = sprite.scale;
                s.x          = Mathf.Sign(s.x);
                s.y          = Mathf.Sign(s.y);
                s.z          = Mathf.Sign(s.z);
                sprite.scale = s;
                GUI.changed  = true;
            }

            if (GUILayout.Button(new GUIContent("Bake Scale", "Transfer scale from transform.scale -> sprite")))
            {
                tk2dScaleUtility.Bake(sprite.transform);
                GUI.changed = true;
            }

            GUIContent pixelPerfectButton = new GUIContent("1:1", "Make Pixel Perfect");
            if (GUILayout.Button(pixelPerfectButton))
            {
                if (tk2dPixelPerfectHelper.inst)
                {
                    tk2dPixelPerfectHelper.inst.Setup();
                }
                sprite.MakePixelPerfect();
                GUI.changed = true;
            }

            sprite.pixelPerfect = GUILayout.Toggle(sprite.pixelPerfect, new GUIContent("Always", "Always keep pixel perfect"), GUILayout.Width(60.0f));
            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.IntSlider("Need a collection bound", 0, 0, 1);
        }

        bool needUpdatePrefabs = false;

        if (GUI.changed)
        {
            EditorUtility.SetDirty(sprite);
#if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            if (PrefabUtility.GetPrefabType(sprite) == PrefabType.Prefab)
            {
                needUpdatePrefabs = true;
            }
#endif
        }

        // This is a prefab, and changes need to be propagated. This isn't supported in Unity 3.4
        if (needUpdatePrefabs)
        {
#if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            // Rebuild prefab instances
            tk2dBaseSprite[] allSprites = Resources.FindObjectsOfTypeAll(sprite.GetType()) as tk2dBaseSprite[];
            foreach (var spr in allSprites)
            {
                if (PrefabUtility.GetPrefabType(spr) == PrefabType.PrefabInstance &&
                    PrefabUtility.GetPrefabParent(spr.gameObject) == sprite.gameObject)
                {
                    // Reset all prefab states
                    var propMod = PrefabUtility.GetPropertyModifications(spr);
                    PrefabUtility.ResetToPrefabState(spr);
                    PrefabUtility.SetPropertyModifications(spr, propMod);

                    spr.ForceBuild();
                }
            }
#endif
        }
    }
Exemple #13
0
    protected void DrawSpriteEditorGUI(tk2dBaseSprite sprite)
    {
        Event ev = Event.current;

        tk2dSpriteGuiUtility.SpriteSelector(sprite.Collection, sprite.spriteId, spriteChangedCallbackInstance, null);

        if (sprite.Collection != null)
        {
            if (tk2dPreferences.inst.displayTextureThumbs)
            {
                tk2dSpriteDefinition def = sprite.GetCurrentSpriteDef();
                if (sprite.Collection.version < 1 || def.texelSize == Vector2.zero)
                {
                    string message = "";

                    message = "No thumbnail data.";
                    if (sprite.Collection.version < 1)
                    {
                        message += "\nPlease rebuild Sprite Collection.";
                    }

                    tk2dGuiUtility.InfoBox(message, tk2dGuiUtility.WarningLevel.Info);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel(" ");

                    int  tileSize = 128;
                    Rect r        = GUILayoutUtility.GetRect(tileSize, tileSize, GUILayout.ExpandWidth(false));
                    tk2dGrid.Draw(r);
                    thumbnailCache.DrawSpriteTextureInRect(r, def, Color.white);

                    GUILayout.EndHorizontal();

                    r = GUILayoutUtility.GetLastRect();
                    if (ev.type == EventType.MouseDown && ev.button == 0 && r.Contains(ev.mousePosition))
                    {
                        tk2dSpriteGuiUtility.SpriteSelectorPopup(sprite.Collection, sprite.spriteId, spriteChangedCallbackInstance, null);
                    }
                }
            }

            sprite.color = EditorGUILayout.ColorField("Color", sprite.color);
            Vector3 newScale = EditorGUILayout.Vector3Field("Scale", sprite.scale);
            if (newScale != sprite.scale)
            {
                sprite.scale = newScale;
                sprite.EditMode__CreateCollider();
            }

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("HFlip"))
            {
                Vector3 s = sprite.scale;
                s.x         *= -1.0f;
                sprite.scale = s;
                GUI.changed  = true;
            }
            if (GUILayout.Button("VFlip"))
            {
                Vector3 s = sprite.scale;
                s.y         *= -1.0f;
                sprite.scale = s;
                GUI.changed  = true;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button(new GUIContent("Reset Scale", "Set scale to 1")))
            {
                Vector3 s = sprite.scale;
                s.x          = Mathf.Sign(s.x);
                s.y          = Mathf.Sign(s.y);
                s.z          = Mathf.Sign(s.z);
                sprite.scale = s;
                GUI.changed  = true;
            }

            if (GUILayout.Button(new GUIContent("Bake Scale", "Transfer scale from transform.scale -> sprite")))
            {
                tk2dScaleUtility.Bake(sprite.transform);
                GUI.changed = true;
            }

            GUIContent pixelPerfectButton = new GUIContent("1:1", "Make Pixel Perfect");
            if (GUILayout.Button(pixelPerfectButton))
            {
                if (tk2dPixelPerfectHelper.inst)
                {
                    tk2dPixelPerfectHelper.inst.Setup();
                }
                sprite.MakePixelPerfect();
                GUI.changed = true;
            }

            sprite.pixelPerfect = GUILayout.Toggle(sprite.pixelPerfect, new GUIContent("Always", "Always keep pixel perfect"), GUILayout.Width(60.0f));
            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.IntSlider("Need a collection bound", 0, 0, 1);
        }

        bool needUpdatePrefabs = false;

        if (GUI.changed)
        {
            EditorUtility.SetDirty(sprite);
#if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            if (PrefabUtility.GetPrefabType(sprite) == PrefabType.Prefab)
            {
                needUpdatePrefabs = true;
            }
#endif
        }

        // This is a prefab, and changes need to be propagated. This isn't supported in Unity 3.4
        if (needUpdatePrefabs)
        {
#if !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
            // Rebuild prefab instances
            tk2dBaseSprite[] allSprites = Resources.FindObjectsOfTypeAll(sprite.GetType()) as tk2dBaseSprite[];
            foreach (var spr in allSprites)
            {
                if (PrefabUtility.GetPrefabType(spr) == PrefabType.PrefabInstance &&
                    PrefabUtility.GetPrefabParent(spr.gameObject) == sprite.gameObject)
                {
                    // Reset all prefab states
                    var propMod = PrefabUtility.GetPropertyModifications(spr);
                    PrefabUtility.ResetToPrefabState(spr);
                    PrefabUtility.SetPropertyModifications(spr, propMod);

                    spr.ForceBuild();
                }
            }
#endif
        }
    }
Exemple #14
0
        public static void InitVFX()
        {
            VFXScapeGoat = new GameObject();
            UnityEngine.Object.DontDestroyOnLoad(VFXScapeGoat);
            PrivateVFXCollection = SpriteBuilder.ConstructCollection(VFXScapeGoat, "OMITBVFXCollection");

            GameObject errorshellsvfx = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/MiscVFX/errorshellsoverhead_vfx", new GameObject("ErrorShellsIcon"));

            errorshellsvfx.SetActive(false);
            tk2dBaseSprite vfxSprite = errorshellsvfx.GetComponent <tk2dBaseSprite>();

            vfxSprite.GetCurrentSpriteDef().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter, vfxSprite.GetCurrentSpriteDef().position3);
            FakePrefab.MarkAsFakePrefab(errorshellsvfx);
            UnityEngine.Object.DontDestroyOnLoad(errorshellsvfx);
            EasyVFXDatabase.ERRORShellsOverheadVFX = errorshellsvfx;

            List <string> SpareVFXPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_001",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_002",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_003",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_004",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_005",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_006",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_007",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_008",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_009",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_010",
                "NevernamedsItems/Resources/MiscVFX/spared_vfx_011",
            };
            GameObject spareVFX = CreateVFX("GundertaleSpare", SpareVFXPaths, 16, new IntVector2(34, 14), tk2dBaseSprite.Anchor.LowerCenter, true, 0.18f, 100, Color.yellow);

            EasyVFXDatabase.GundetaleSpareVFX = spareVFX;

            List <string> SpeedUpVFX = new List <string>()
            {
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_001",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_002",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_003",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_004",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_005",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_006",
                "NevernamedsItems/Resources/StatVFX/speedup_vfx_007",
            };
            GameObject SpeedUpVFXObj = CreateVFX("Speed Up VFX", SpeedUpVFX, 16, new IntVector2(27, 17), tk2dBaseSprite.Anchor.LowerCenter, true, 0.18f, 100, Color.yellow);

            EasyVFXDatabase.SpeedUpVFX = SpeedUpVFXObj;

            EasyVFXDatabase.BigWhitePoofVFX = CreateVFX("Big White Poof",
                                                        new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/bigwhitepoof_001",
                "NevernamedsItems/Resources/MiscVFX/bigwhitepoof_002",
                "NevernamedsItems/Resources/MiscVFX/bigwhitepoof_003",
                "NevernamedsItems/Resources/MiscVFX/bigwhitepoof_004",
            },
                                                        10,                                 //FPS
                                                        new IntVector2(36, 36),             //Dimensions
                                                        tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                        false,                              //Uses a Z height off the ground
                                                        0                                   //The Z height, if used
                                                        );

            EasyVFXDatabase.BloodExplosion = CreateVFX("Blood Explosion VFX",
                                                       new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_001",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_002",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_003",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_004",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_005",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_006",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_007",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_008",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_009",
                "NevernamedsItems/Resources/MiscVFX/Explosions/bloodexplosion_010",
            },
                                                       10,                                 //FPS
                                                       new IntVector2(71, 71),             //Dimensions
                                                       tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                       false,                              //Uses a Z height off the ground
                                                       0                                   //The Z height, if used
                                                       );
            GameObject debrislauncher = new GameObject();

            debrislauncher.MakeFakePrefab();
            debrislauncher.transform.parent = EasyVFXDatabase.BloodExplosion.transform;
            debrislauncher.AddComponent <ExplosionDebrisLauncher>();

            #region ArcExplosion
            GameObject indevArcExplosion = CreateVFX("ARC Explosion",
                                                     new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_001",
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_002",
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_003",
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_004",
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_005",
                "NevernamedsItems/Resources/MiscVFX/shittyarcsplosion_006",
            },
                                                     10,                                 //FPS
                                                     new IntVector2(66, 64),             //Dimensions
                                                     tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                     false,                              //Uses a Z height off the ground
                                                     0                                   //The Z height, if used
                                                     );

            indevArcExplosion.GetComponent <tk2dBaseSprite>().sprite.usesOverrideMaterial = true;
            Material mat = new Material(EnemyDatabase.GetOrLoadByName("GunNut").sprite.renderer.material);
            mat.mainTexture = indevArcExplosion.GetComponent <tk2dBaseSprite>().sprite.renderer.material.mainTexture;
            mat.SetColor("_EmissiveColor", ExtendedColours.skyblue);
            mat.SetFloat("_EmissiveColorPower", 1.55f);
            mat.SetFloat("_EmissivePower", 100);
            indevArcExplosion.GetComponent <tk2dBaseSprite>().sprite.renderer.material = mat;

            EasyVFXDatabase.ShittyElectricExplosion = indevArcExplosion;
            #endregion


            #region RainbowGuonPoofs
            //RED
            List <string> RedPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/redpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/redpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/redpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/redpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/redpoof_005",
            };
            RainbowGuonStone.RedGuonTransitionVFX = CreateVFX("RedGuonPoof", RedPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //ORANGE
            List <string> OrangePoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/orangepoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/orangepoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/orangepoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/orangepoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/orangepoof_005",
            };
            RainbowGuonStone.OrangeGuonTransitionVFX = CreateVFX("OrangeGuonPoof", OrangePoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //YELLOW
            List <string> YellowPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/yellowpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/yellowpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/yellowpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/yellowpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/yellowpoof_005",
            };
            RainbowGuonStone.YellowGuonTransitionVFX = CreateVFX("YellowGuonPoof", YellowPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //GREEN
            List <string> GreenPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greenpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greenpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greenpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greenpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greenpoof_005",
            };
            RainbowGuonStone.GreenGuonTransitionVFX = CreateVFX("GreenGuonPoof", GreenPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //BLUE
            List <string> BluePoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/bluepoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/bluepoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/bluepoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/bluepoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/bluepoof_005",
            };
            RainbowGuonStone.BlueGuonTransitionVFX = CreateVFX("BlueGuonPoof", BluePoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //WHITE
            List <string> WhitePoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/whitepoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/whitepoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/whitepoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/whitepoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/whitepoof_005",
            };
            RainbowGuonStone.WhiteGuonTransitionVFX = CreateVFX("WhiteGuonPoof", WhitePoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //CYAN
            List <string> CyanPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/cyanpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/cyanpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/cyanpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/cyanpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/cyanpoof_005",
            };
            RainbowGuonStone.CyanGuonTransitionVFX = CreateVFX("CyanGuonPoof", CyanPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //GOLD
            List <string> GoldPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/goldpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/goldpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/goldpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/goldpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/goldpoof_005",
            };
            RainbowGuonStone.GoldGuonTransitionVFX = CreateVFX("GoldGuonPoof", GoldPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //GREY
            List <string> GreyPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greypoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greypoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greypoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greypoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/greypoof_005",
            };
            RainbowGuonStone.GreyGuonTransitionVFX = CreateVFX("GreyGuonPoof", GreyPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //BROWN
            List <string> BrownPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/brownpoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/brownpoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/brownpoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/brownpoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/brownpoof_005",
            };
            RainbowGuonStone.BrownGuonTransitionVFX = CreateVFX("BrownGuonPoof", BrownPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            //INDIGO
            List <string> IndigoPoofPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/indigopoof_001",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/indigopoof_002",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/indigopoof_003",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/indigopoof_004",
                "NevernamedsItems/Resources/MiscVFX/RainbowGuonPoofs/indigopoof_005",
            };
            RainbowGuonStone.IndigoGuonTransitionVFX = CreateVFX("IndigoGuonPoof", IndigoPoofPaths, 14, new IntVector2(21, 22), tk2dBaseSprite.Anchor.MiddleCenter, false, 0);
            #endregion

            laserSightPrefab = LoadHelper.LoadAssetFromAnywhere("assets/resourcesbundle/global vfx/vfx_lasersight.prefab") as GameObject;
        }