I currently am in a position where I have several selectable characters at the start of my game, and of course each one has a different portrait. I am using an actor, "Player" and currently setting the name like this:
Code: Select all
DialogueLua.SetActorField("Player", "Display Name", playerName);
Code: Select all
Sprite playerPortrait = Resources.Load<Sprite>("PlayerCharacters/player1/Player1_portrait");
Code: Select all
Sprite playerPortrait = Resources.Load<Sprite>("PlayerCharacters/player1/Player1_portrait");
Sprite[] playerPortraits = new Sprite[1];
playerPortraits[0] = playerPortrait;
DialogueLua.SetActorField("Player", "Pictures", playerPortraits);
OR
...
DialogueLua.SetActorField("Player", "Player Portraits", playerPortraits);
...
What I need to figure out is a way to set the actor's portrait at runtime. Is there a way?
Thanks!