Scoreboard ⚽
You need to own this item to leave a rating.
This is a scoreboard script that will allow you to keep score for current people in the scene, and a highscore of top players which can also be persistent if used with the accompanied database script.
The scoreboard can be displayed on a media surface (media shader) and can be customized with the following:
- scoreboard title
- background color
- font color
- branding banner image
- width and height in pixels
- Timer or score based
To setup the persistent database you must include a second script (Database), and give it some random numbers and a name. The numbers you pick in the script will be like your database ID and you should keep a backup of those numbers in case you delete the script by mistake. Deleting the script will not delete the data. You may reuse the same database numbers in different experiences if you want to share the data between them. Check the debug console (ctrl + d) if the script does not seem responsive, it will give hints on what you did wrong.
Scripters can plug in to the scoreboard reflective to extend functionality:
publuic interface IScoreboardReflective {
Dictionary<string, float> GetTopScores();
Dictionary<string, float> GetCurrentScores();
void AddScore(string name, float amount);
void RemoveScore(string name);
void RemoveTopScore(string name);
void ResetCurrentScores();
void ResetTopScores();
IEventSubscription SubscribeToScoreChange(Action<string, float> handler);
IEventSubscription SubscribeToTopScoresChange(Action handler);
bool IsEnabled();
string Name {get;}
}
This can be used like so:
ScenePrivate.FindReflective<IScoreboardReflective>("Scoreboard.ScoreboardReflective")