I see you are using billboarding, so the sprite should always be facing the camera, so that wouldn’t be the problem.
Verify the material you’re using is actually pointing to the correct texture. And make sure the SpriteManager object is positioned at the origin (0,0,0). If that’s off, it can offset all your sprites, possibly making it so you couldn’t see them.
Download the demo package in the SpriteManager thread and look at how everything is being done there - that should give you something to go off of. I’ll reply again if I think of any other possible pitfalls.
For the time being, however, if you aren’t using SpriteManager’s animation features, you can get the same drawcall reduction benefits now with Unity’s new automatic dynamic batching, where meshes with the same material get combined into a single drawcall, much like SpriteManager.
Is there something you have to do to turn on automatic batching? I didn’t see much of a performance increase when I switched to 1.5.
One other question I had…I’m wondering if I’m referencing the object correctly. How do you reference the game object a script is attached to? I was using gameObject, but I don’t know if that’s correct.
and, btw, the sprite thing works when I tried it in my test script like this:
var spriteMan : SpriteManager;
var spriteShip : GameObject;
//var test : Sprite;
@System.NonSerialized
var spawnPoint : GameObject;
@System.NonSerialized var instantiatedShip : GameObject;
function Update () {
}
function Start(){
spawnPoint = GameObject.Find("EnemySpawn");
CreateShip();
//CreateSprites();
}
function CreateShip(){
instantiatedShip = Instantiate(spriteShip, spawnPoint.transform.position, spawnPoint.transform.rotation);
var test : Sprite = spriteMan.AddSprite(instantiatedShip, 3, 3, 1, 1, 512, 512, true);
}
No, you don’t have to turn it on, it’s automatic. You won’t notice any improvement, however, if you aren’t already using a lot of draw calls (30 or so).
Yes, if you’re “inside” a script attached to a GameObject, then just using “gameObject” will work. At least it does in C#, so I’m assuming it would in JS as well.