private void OnButtonClicked() { if (Cloud.IsSignedIn) { androidUtils.ShowSelectDialog( "Sign Out?", "Are you sure you want to sign out?", b => { if (b) { Cloud.SignOut(); } }); } else { Cloud.SignIn(); } }
private void BuyableCharacter(int charIndex, int cost, bool isUnlocked) { if (isUnlocked) { if (currentCharacter == characters[charIndex]) { panelManager.GoToMainMenu(); return; } PlayerSettings.CurrentCharacterId = charIndex; SetCurrentCharacter(characters[charIndex]); } else if (CloudVariables.Cherries >= cost) { #if UNITY_ANDROID && !UNITY_EDITOR androidUtils.ShowSelectDialog( "Are you sure?", "Unlock this character with " + cost + " cherries?", confirm => { if (confirm) { BuyCharacterImpl(charIndex, cost); } }); #else BuyCharacterImpl(charIndex, cost); #endif } else { #if DEBUG Debug.Log("Not enough cherries"); #endif } }