Skip to content

Instantly share code, notes, and snippets.

@ruslux
Created February 16, 2021 13:31
Show Gist options
  • Save ruslux/c357d6c6ca8775ed171b022d39c1aca0 to your computer and use it in GitHub Desktop.
Save ruslux/c357d6c6ca8775ed171b022d39c1aca0 to your computer and use it in GitHub Desktop.
class ExampleButtonMapper: TeseBehaviour {
[Inject] public NetworkManager NetworkManager;
[Inject] public ProfileManager ProfileManager;
[Inject] public SoundManager SoundManager;
[Inject] public WindowManager WindowManager;
public async void _OnButton()
{
if (ProfileManager.HasResourcesToUpgrade()) {
SoundManager.PlayButtonSound();
await NetworkManager.UpgradeAbility();
}
else
{
SoundManager.PlayErrorSound();
WindowManager.ShowNotEnough();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment