In my use case i want a prompt icon to be display normally if one is found for both the PromptIcon and PromptText and one to not attempt to be displayed if one is not found.
I figured the best way to do this might be another setting in the settings SO. There's a few ways I have devised doing this. I will list them below.
- A single setting for both
PromptIcon and PromptText that defines what to do if a sprite is not found.
public enum SpriteNotFoundBehavior
{
///<summary>
/// Let each component handle what happens individually if a sprite is not found.
///</summary>
Default,
///<summary>
/// In the case of PromptText wherever [Example/Prompt] comes up short display nothing.
/// In the case of PromptIcon wherever [Example/Prompt] comes up short disable Gameobject or Image component.
///</summary>
SuppressDisplay
}
- A settings for both
PromptIcon and PromptText that defines how we should handle sprite not found scenarios.
PromptIconSpriteNotFoundBehavior
{
///<summary>
/// Do nothing (current behavior)
///</summary>
Default,
///<summary>
/// Disable the gameobject that the PromptIcon is attached to when sprite is not found.
///</summary>
DisableGameobject,
///<summary>
/// Disable the Image component that the PromptIcon is attached to when sprite is not found.
///</summary>
DisableImage
}
PromptTextSpriteNotFoundBehavior
{
///<summary>
/// Display error message that's the reason for no sprite showing (current behavior)
///</summary>
Default,
///<summary>
/// Skips over any [Example/Prompt] that can't be found, preserving the text as it was.
///</summary>
PreserveOriginalText
}
- A debug mode variable in the settings
bool debugMode. When enabled it will display why icons for devices aren't showing as they potentially should be. Sort of how PromptText works. In the case of PromptIcon perhaps there is a debug sprite that shows when no sprite can be found in order to visually see that this is the case.
Let me know what you think :). I will likely roll one of these solutions on my own project immediately, as I need this functionality, but I'm curious if anyone has any input on what might be the best behavior.
In my use case i want a prompt icon to be display normally if one is found for both the
PromptIconandPromptTextand one to not attempt to be displayed if one is not found.I figured the best way to do this might be another setting in the settings SO. There's a few ways I have devised doing this. I will list them below.
PromptIconandPromptTextthat defines what to do if a sprite is not found.PromptIconandPromptTextthat defines how we should handle sprite not found scenarios.bool debugMode. When enabled it will display why icons for devices aren't showing as they potentially should be. Sort of howPromptTextworks. In the case ofPromptIconperhaps there is a debug sprite that shows when no sprite can be found in order to visually see that this is the case.Let me know what you think :). I will likely roll one of these solutions on my own project immediately, as I need this functionality, but I'm curious if anyone has any input on what might be the best behavior.