Hi.
I am trying to implement my own procedual avatar system into ORK3.
Here is Textire2D FooClass.GetTexture2D(Combatant combatant) .
(ex. Warrior A and Warrior B has different Face Portrait Texure)
And I want to Display these Portrait texture in Combatant Infomation HUD just like combatant Icon.
There is some way to display em.1st I tried to change icon properties on combatants.
but icon is depends on TMP. so It seems hard to change that.
Is there a good solution for display em into HUD?
ORK also has a built-in system (portrait sets for your combatants) to allow switching between them.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
public class CustomPortrait : MonoBehaviour
{
public HUDContentProviderComponent provider;
void Start()
{
Combatant combatant = ORKComponentHelper.ToCombatant(this.provider.User);
Image img = GetComponent<Image>();
Texture2D tex = FooClass.GetTexture2D(combatant) ;
img.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero);
}
}
Best way is creating custum HUD components. but it works enough for me.
Is it wrong?
convatant has string variable which contains Base64 encoded texture image.
FooClass decodes that Base64 string to texture image.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!