How to change the Actor's Portrait with c# codes?
Posted: Wed Jul 08, 2020 12:42 pm
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!
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!