Without further ado I present to you MessageBox, a Unity MessageBox implementation of the .NET MessageBox. Complete with selectable buttons and icons. It uses Callbacks instead of the inline way that the .NET version does, however it is similar in every other way.
Runtime |
.NET Example:
var result = MessageBox.Show("This is the text", "This is the Title", MessageBoxButtons.YesNo); if(result == DialogResult.Yes) { Console.Write("Yes"); } else { Console.Write("No"); }
Unity Example:
void Start() { MessageBox.Show(HandleMessage,"This is the text", "This is the Title", MessageBoxButtons.YesNo); } void HandleMessage(DialogResult result) { if(result == DialogResult.Yes) { Console.Write("Yes"); } else { Console.Write("No"); } }Which is very similar with the only change being the callback in the beginning (HandleMessage) which can be any method as long as it accepts a DialogResult parameter.
Version: 1.0
Unity Version: 3.4.1 Free
Price: $2
Asset Store Link: http://u3d.as/content/corrupted-smile-studio/message-box/2Eo
Web Player Demo.
Regards,
Garth
No comments:
Post a Comment