In my case, i want to generate enemies by using one game objects and set the sprite and script during init callback. it is possible? because there are too many animations for enemies(in total about 150), it’s not very convenient to make go for all the enemies and make factory for them, so i decide to change the texture and behavior script in runtime. it’s possible?
for example in init callback something like this:
go.set("#sprite",“image”,{path = “main/graphic/enemy1.atlas”})
i know it can be done by set_texture in gui,so what about in go?
In the atlas you can setup animations. You want to include all sprites in a single atlas in this case. You could also have multiple sprites on a go with a different atlas associated with each sprite, and then disable/enable which one based on unit.