Created
February 16, 2021 13:31
-
-
Save ruslux/c357d6c6ca8775ed171b022d39c1aca0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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