Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - shaz68

Pages: [1]
1
Support / Is it possible to create an animation via code?
« on: February 22, 2012, 10:26:25 pm »
This post has been really helpful, but I'm wondering if I can take it further.  Is it possible to create the anim via code - selecting the sprite collection, setting up the clips, listing the frames for each clip?  I had a go, but I got as far as not being able to create a tk2dSpriteAnimation using new because it's a MonoBehaviour and needs to be attached as a component.  At this point, I'm trying to create the animation so I can attach it to objects as a component.

2
Support / Loading and unloading of resources
« on: February 22, 2012, 02:36:29 am »
I am instantiating animated objects from prefabs, then using Resources.Load() to change the animation.

If I do this in a loop and create 10 objects, is the resource actually loaded 10 times, or just once, and all objects use the same animation?

Do I have to do anything to unload the resource when the scene changes, or will all of the objects being destroyed trigger garbage collection on the animation?

3
Support / How to reduce project exe and data size?
« on: February 20, 2012, 05:22:49 am »
I am porting a game to Unity that was originally made with TGB. 

In TGB every image was a separate png file, and levels were built via code rather than saved as scenes containing the images.  The resulting exe is 1.5MB and the entire game folder is 22MB.

In Unity, I've imported all the assets into the project folder and put all of the sprites into sprite collections (I took mostly the default settings, other than changing the anchor point and collision box).  Most of the sprite collections generated a 1024x1024 or 1024x2048 sheet.  When I build the game (again using the default build options), the exe is 8.1MB and the entire game folder is 85.9MB.

This is a HUGE difference, and there is a LOT still to be added to the Unity version (animations, audio, lots more code).  Just the sharedassets files combined are twice the size of the entire TGB game.  I don't know where to begin looking to get the size of the exe and project down.  Is this big difference something that's standard with Unity, or peculiar to the 2d toolkit?  Can I load the sprite collections and animations at runtime, or does Unity already do that?  Any ideas what things I can change to reduce these numbers?

4
Support / Commit and Edit buttons disappeared from sprite collection
« on: February 17, 2012, 03:08:24 am »
I created several sprite collections, and they were working fine.  I wanted to add a few extra sprites to one collection, so I locked the collection in the inspector, found the sprites and dragged them onto the texture refs.  They were added okay, but I no longer have the Commit button to save the collection.  The edit button is also missing, and neither change when I unlock the collection in the inspector.

As I look through the other collections, which I have not touched, none of those have a Commit or Edit button anymore either.  I have closed my Unity project and reopened, but the buttons are still missing.

There are only two components on each of my collections - a Transform, and a Tk 2D Sprite Collection script.


If I create a new SpriteCollection, it is also missing the two buttons.  I also reimported the tk2d resources and still have the issue.

5
Support / Reducing the number of animations created
« on: February 15, 2012, 03:34:06 am »
I have 30+ different spritesheets that all follow exactly the same animation pattern - 4 directions, 4 frames per direction. 

What I'd LIKE to do is create one animation and one animated sprite prefab with the four directions, then when I instantiate each one via script, tell it which spritesheet to use.  I don't see a way to easily do that - instead, it looks like I have to create an animation for every single one.  I will have several sprite collections, each one with between 6 and 10 of these spritesheets.

Is this right?  Is there an easier way than creating 30+ animations manually?

Pages: [1]