示例#1
0
        public static void Init(AssetBundle expandSharedAssets1)
        {
            CorruptedJunkObject = expandSharedAssets1.LoadAsset <GameObject>("Corrupted Junk");

            CorruptedJunk poopSack = CorruptedJunkObject.AddComponent <CorruptedJunk>();

            ItemBuilder.AddSpriteToObject(CorruptedJunkObject, expandSharedAssets1.LoadAsset <Texture2D>("corrupted_poopsack_09"), false, false);

            string shortDesc = "Next Time... What even is this!?";
            string longDesc  = "Just some corrupted junk.\n\nCarrying this around makes you question your sanity...";

            ItemBuilder.SetupItem(poopSack, shortDesc, longDesc, "ex");
            poopSack.quality      = ItemQuality.A;
            poopSack.CanBeDropped = false;

            m_SpriteNames = new List <string> {
                "corrupted_poopsack_01",
                "corrupted_poopsack_02",
                "corrupted_poopsack_03",
                "corrupted_poopsack_04",
                "corrupted_poopsack_05",
                "corrupted_poopsack_06",
                "corrupted_poopsack_07",
                "corrupted_poopsack_08",
                "corrupted_poopsack_09",
                "corrupted_poopsack_10"
            };

            foreach (string spritePath in m_SpriteNames)
            {
                if (spritePath != "corrupted_poopsack_09")
                {
                    SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spritePath), CorruptedJunkObject.GetComponent <tk2dSprite>().Collection);
                }
            }

            ExpandUtility.GenerateSpriteAnimator(CorruptedJunkObject, playAutomatically: true);
            ExpandUtility.AddAnimation(CorruptedJunkObject.GetComponent <tk2dSpriteAnimator>(), CorruptedJunkObject.GetComponent <tk2dSprite>().Collection, m_SpriteNames, "idle", tk2dSpriteAnimationClip.WrapMode.RandomLoop, 20);
        }
        public static void Init(AssetBundle expandSharedAssets1)
        {
            CorruptedJunkObject = expandSharedAssets1.LoadAsset <GameObject>("Corrupted Junk");

            CorruptedJunk poopSack = CorruptedJunkObject.AddComponent <CorruptedJunk>();

            SpriteSerializer.AddSpriteToObject(CorruptedJunkObject, ExpandPrefabs.EXItemCollection, "corrupted_poopsack_09");

            string shortDesc = "Next Time... What even is this!?";
            string longDesc  = "Just some corrupted junk.\n\nCarrying this around makes you question your sanity...";

            ItemBuilder.SetupItem(poopSack, shortDesc, longDesc, "ex");
            poopSack.quality = ItemQuality.A;
            if (!ExpandSettings.EnableEXItems)
            {
                poopSack.quality = ItemQuality.EXCLUDED;
            }
            poopSack.CanBeDropped = false;
            CorruptedJunkID       = poopSack.PickupObjectId;

            m_SpriteNames = new List <string> {
                "corrupted_poopsack_01",
                "corrupted_poopsack_02",
                "corrupted_poopsack_03",
                "corrupted_poopsack_04",
                "corrupted_poopsack_05",
                "corrupted_poopsack_06",
                "corrupted_poopsack_07",
                "corrupted_poopsack_08",
                "corrupted_poopsack_09",
                "corrupted_poopsack_10"
            };

            ExpandUtility.GenerateSpriteAnimator(CorruptedJunkObject, playAutomatically: true);
            ExpandUtility.AddAnimation(CorruptedJunkObject.GetComponent <tk2dSpriteAnimator>(), ExpandPrefabs.EXItemCollection.GetComponent <tk2dSpriteCollectionData>(), m_SpriteNames, "idle", tk2dSpriteAnimationClip.WrapMode.RandomLoop, 20);
        }