BlueScreenManager.cs - UF-CSSALT/SMARTS-SDK-Unity-Asset-Package GitHub Wiki
The BlueScreenManager class's function is similar to that of a crash screen of any other program: to give feedback of errors to developers using the SMARTS-SDK. The principle errors tracked are that of the ATC (tracking controller) or MC (microcontroller) failures of varying causes.
The BlueScreenManager is used as a singleton, having a single static reference to itself in the scene. Any excess instances of the script existing within the scene will be destroyed in Awake().
Namespace
SMARTS_SDK:
To use the BlueScreenManager for its intended use of getting feedback on the use of SMARTS_SDK, the SMARTS_SDK must obviously be used.
Static Fields
BlueScreenManager.ME
This is a singleton reference of the BlueScreenManager.cs script, providing access to it in any external scripts using the SMARTS_SDK namespace.
Public Methods
void UpdateReferences()
Sets various state booleans that track whether the ATC or MC (using their class references) are:
- Present
- Enabled
- Connected
- Have input from Replay Data
- In power failure (for the ATC only)
The booleans are named as follows:
bool ATCPresent = false;
bool MCPresent = false;
bool ATCEnabled = false;
bool MCEnabled = false;
bool ATCConnected = false;
bool MCConnected = false;
bool ATCReplayingDetected = false;
bool MCReplayingDetected = false;
bool ATCPowerFailure = false;
void DetermineMessage()
Based on combinations of the state variables set by UpdateReferences(), an "error number" is passed to the SetupBlueScreen() method.
void SetupBlueScreen(int errorType)
Depending on the "error number" passed into this method, whether or not a blue screen appears, and the way the blue screen appears to the user varies.
The blue screen, if shown, has 4 components:
- Title Text: the basic description of the error
- Diagnostic Text: a more technical description
- Troubleshoot Text: an explanation of how to address the error
- Error Image: an appropriate image sprite for the error