Hi,
Sorry to ask the stupid question. I've checked the docs about "SetPortrait()", but i dont find a definitely way to show me how to do that with a c# script.
In the docs there is a method: "static void PixelCrushers.DialogueSystem.DialogueManager.SetPortrait(string actorName, string portraitName)". And in the interpretation, it tells me that i can "Sets an actor's portrait by the name of a texture in a Resources folder". But when i typing the code, an error occured.
For example:
My actor's name is "Enemy".
And the portrait path is "Resources/Prefabs/Textures/HeadPhoto4".
Is there anything wrong with the code " PixelCrushers.DialogueSystem.DialogueSystemController.SetPortrait("Enemy", "Resources/Prefabs/Textures/HeadPhoto4"); " ?
Or is there any references about this?
Thanks for your help!
How to change the Actor's Portrait with c# codes?
-
- Posts: 6
- Joined: Mon Jul 06, 2020 11:15 am
Re: How to change the Actor's Portrait with c# codes?
Hi,
Here's the API info: DialogueManager.SetPortrait
Change your code to:
Here's the API info: DialogueManager.SetPortrait
Change your code to:
Code: Select all
PixelCrushers.DialogueManager.SetPortrait("Enemy", "Prefabs/Textures/HeadPhoto4");
-
- Posts: 6
- Joined: Mon Jul 06, 2020 11:15 am
Re: How to change the Actor's Portrait with c# codes?
Got it, thank you very much!
Re: How to change the Actor's Portrait with c# codes?
Glad to help!