The service allows you to show a message to the user (information about status, reward, Internet problems, etc.).
To get started:
Add prefab “Message” to the first scene.
Message
Message interactions happen in this class.
- Methods
Show a regular text message
Message.Show("NOT_ENOUGH_FUNDS");
or
Message.Show(MessageCode.NOT_ENOUGH_FUNDS);
Show – shows a text message. You can call it via string or enum, both options are given above.
*By default, all messages are translated using the localization system.
Show reward message
Message.ShowReward("Award information", "Path to image in resources: Sprites/Icons/...");
ShowReward – shows a reward message with an image.
Showing a message about internet problems
private void SomeMethod()
{
Message.ShowConnectionError(null);
or
Message.ShowConnectionError(OnInternetError);
}
private void OnInternetError()
{
//Do Something
}
*By default, all this is automated
ShowConnectionError – there are 2 options for showing this message:
1. If you do not need to resend requests or perform any actions you need to pass the “null” argument, the “ok” button will be displayed.
2. If you need the user to re-execute requests, then pass as an argument a method that will be called every time the user presses the “Repeat” button.