Image in alert and multi platform support
Posted: Fri Dec 22, 2017 9:13 am
Hello,
I'm currently in the process of implementing tutorial steps in my game. What I thought of is to launch an Alert, for a few seconds, such as "To sprint, press on X button to make your hero go faster" when hitting an Alert Trigger. I've been able to make it work with localization using a Localized Text Table. However, I have two questions:
1) Is it possible to replace a value in the string for an image? As an example, on Xbox One, to run we use 'X' while on PS4, the 'X' button is replaced by the 'Square' button. I think it is a requirement by the platform to display an image of the button on those platforms instead of writting in text 'X' button and 'Square' button.
2) What would be the best way for me to handle platform handling? I was thinking of having a GameObject with a BoxCollider2D, two Alert Trigger scripts (one for Xbox One, one for PS4) and one custom script implementing the OnTriggerEnter2D function what will call OnUse on the valid Alert Trigger script based if UNITY_PS4 or UNITY_XBOXONE is defined. Would that make sense? Do you see a better solution?
Thanks!
I'm currently in the process of implementing tutorial steps in my game. What I thought of is to launch an Alert, for a few seconds, such as "To sprint, press on X button to make your hero go faster" when hitting an Alert Trigger. I've been able to make it work with localization using a Localized Text Table. However, I have two questions:
1) Is it possible to replace a value in the string for an image? As an example, on Xbox One, to run we use 'X' while on PS4, the 'X' button is replaced by the 'Square' button. I think it is a requirement by the platform to display an image of the button on those platforms instead of writting in text 'X' button and 'Square' button.
2) What would be the best way for me to handle platform handling? I was thinking of having a GameObject with a BoxCollider2D, two Alert Trigger scripts (one for Xbox One, one for PS4) and one custom script implementing the OnTriggerEnter2D function what will call OnUse on the valid Alert Trigger script based if UNITY_PS4 or UNITY_XBOXONE is defined. Would that make sense? Do you see a better solution?
Thanks!