Hey all,
I'm currently using sprite manager I for a 2d game and I'm having problems removing sprites.
I have it setup under a LinkedSpriteManager so it updates the sprites automatically.
The problem I'm having is removing the sprite once i'm done with it.
For instance heres what I'm trying when removing the main player sprite
Declare the variables at the start of the class
private GameObject player;
private Sprite playerSprite;
Now in the method that removes the sprite
spriteManager.RemoveSprite(playerSprite);
Destroy(player);
When I try this it doesn't work and throws an error which halts all the other sprites from updating.
The error i get is
NullReferenceException: Object reference not set to an instance of an object
Anyone else had this problem?