I'm having trouble getting SpriteManager 1 to play animations. I've looked around and cant seem to find a good example on how to do it properly.
I setup the player and the animation like this
//Player
GameObject player;
Sprite playerSprite;
public GameObject playerPrefab;
private void setupPlayer() {
//Create and position the player sprite
Vector3 playerStartPos = new Vector3(0,0,0);
player = (GameObject) Instantiate(playerPrefab, playerStartPos, Quaternion.identity);
playerSprite = spriteManager.AddSprite(player, 0.7f, 1f, 10, 397, 50, 100, false);
//Run animation
UVAnimation runAnimation = new UVAnimation();
Vector2 startPosUV = spriteManager.PixelCoordToUVCoord(10, 397);
Vector2 spriteSize = spriteManager.PixelSpaceToUVSpace(0, 50);
runAnimation.BuildUVAnim(startPosUV, spriteSize, 8, 1, 8, 12);
playerSprite.AddAnimation(runAnimation);
runAnimation.name = "run";
}
Then I try to tell the animation to play I do this.
public void Update() {
playerSprite.PlayAnim("run");
}
When It calls the animation wont play. I also tried changing the the startPosUv so it was different from the original position. All that happened was when the play was called it went to that position and didn't animate.
Am I missing something?