I want to be able to embed control icons in my text.
Currently I have a static method I can call that gives me back the current image for a control action I have requested.
This takes into account kb/gamepad usage, and custom control mapping that the player has configured.
I cant see a way to embed this into a text dialog, or anything else with any of the text commands.
Put that into a string variable and use the variable to add the icon to your text - if you need to swap out the icons, just change the text code in the variable.
For this to work, you need to have the icons in a Resources folder in your project.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Now I could do it if I load a prefab from the resources folder, because I can manage the lifecycle internally to the prefab.
The code for this wouldnt need to be much different from the code for an icon, just it would need to cast to a gameobject instead, i expect.
Any suggestions?
Where is the text with the changing icon text codes displayed? E.g. if it's in an Information HUD, you could use the Update By Variables option to recalculate the HUD when global variables change (e.g. the string variables for your icons).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Another option would be a conditional text code where i could do something like
#if SomeObject.SomeStaticFunctionThatReturnsBool()#true_data#else#false_data#endif#
For example.
I'd be happy to write a scanner/parser for you :P (if i can remember my old compilers class, that is)
I'd recommend using an Information HUD for displaying this - e.g. using variables in your display condition to control when to show it. Using the Update By Variables option would automatically udpate it on changes :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!