How do I do this?
So far I have assigning new sprites in an atlas. Using something like this:-
mySprite.spriteName = "other_sprite_name";
This all works but now I want to do something like this.
mySprite.atlasName = "other_atlas_name";
I have searched around on this forum and found .replacement
But I can't seem to get it to work. I have loaded two atlases like this:-
UIAtlas myAtlas1 = Resources.Load("mydir/myAtlas1", typeof(UIAtlas)) as UIAtlas;
UIAtlas myAtlas2 = Resources.Load("mydir/myAtlas2", typeof(UIAtlas)) as UIAtlas;
Then I call my atlas change.
mySprite.atlas.replacement = myAtlas2;
However if I debug the atlas (mySprite.atlas), it is still pointing to myAtlas1.
Am I missing something obvious?