Esempio n. 1
0
            public void BuildCollection()
            {
                if (collection != null)
                {
                    Destroy(collection);
                }

                if (textSprite != null)
                {
                    Destroy(textSprite);
                }

                String name = "SCROLL_COLLECTION";

                collection                      = new tk2dSpriteCollectionData();
                collection.assetName            = name;
                collection.allowMultipleAtlases = false;
                collection.buildKey             = 0x0ade;
                collection.dataGuid             = name + "_DATAGUID";
                collection.spriteCollectionGUID = name + "_GUID";
                collection.spriteCollectionName = name;
                collection.spriteDefinitions    = new tk2dSpriteDefinition[0];
                DontDestroyOnLoad(collection);

                gunID  = SpriteBuilder.AddSpriteToCollection(gunTextSpritePath, collection);
                itemID = SpriteBuilder.AddSpriteToCollection(itemTextSpritePath, collection);

                textSprite = SpriteBuilder.SpriteFromResource(collection, ScrollOfApproxKnowledge.gunTextSpritePath).GetComponent <tk2dSprite>();

                baseScale        = textSprite.scale;
                textSprite.scale = Vector2.zero;
            }
Esempio n. 2
0
        /// <summary>
        /// Creates an object with a sprite component and adds that sprite to the
        /// ammonomicon for later use.
        /// </summary>
        public static GameObject CreateSpriteObject(string name, string resourcePath)
        {
            GameObject spriteObject = SpriteBuilder.SpriteFromResource(_ItemCollection, resourcePath);

            spriteObject.name = name;
            return(spriteObject);
        }