public void GoToAdventureMode() { AdventurePoint adp = (AdventurePoint)FindObjectOfType(typeof(AdventurePoint)); if (adp.AdventurePoints >= 10) { adp.AdventurePoints -= 10; } }
public void BattleEnemy() { AdventurePoint adp = (AdventurePoint)FindObjectOfType(typeof(AdventurePoint)); if (adp.AdventurePoints >= adpPerBattle) { toBattleSound.Play(); Enemy.enabled = true; UpdateEnemyUI(); StartCoroutine(CheckForCurrentLevel()); } else { StartCoroutine(NotEnoughADP()); } }
public void StartTheBattle() { AdventurePoint adp = (AdventurePoint)FindObjectOfType(typeof(AdventurePoint)); waitingCountDownForBattle = 90f; if (enemyPowerLevel == EnemyPowerLevel.Low && fightMode == FightMode.InFight) { adp.AdventurePoints -= 10; RandomizeEnemys(1, 5); if (FirstToFifthLevelEnemys[enemyCounter].Damage < characterInfo.Damage || FirstToFifthLevelEnemys[enemyCounter].Health < characterInfo.Health) { userInfo.SetCharacterLevel(FirstToFifthLevelEnemys[enemyCounter].enemyLevelDrop); PlayerPrefs.SetInt("ADPOINTS", adp.AdventurePoints); StartCoroutine(WaitToBattleAgain(true)); } else { StartCoroutine(WaitToBattleAgain(false)); Debug.Log("you lose "); } } }
public void SignIn() { authType = AuthType.SignIn; SignInemailaddress = SignInEmailAddress.text; SignInpass = SignInPassword.text; var Auth = Firebase.Auth.FirebaseAuth.DefaultInstance; if (Auth != null) { Auth.SignInWithEmailAndPasswordAsync(SignInemailaddress, SignInpass).ContinueWith(task => { if (task.IsCanceled) { Debug.LogError("SignIn With Email And PasswordAsync was canceled."); return; } if (task.IsFaulted) { Debug.LogError("SignIn With Email And PasswordAsync encountered an error: " + task.Exception); StartCoroutine(CustomLog(false)); return; } Firebase.Auth.FirebaseUser newUser = task.Result; StartCoroutine(CustomLog(true)); Debug.LogFormat("User signed in successfully: {0} ({1})", newUser.DisplayName, newUser.UserId); PlayerPrefs.SetString("EMAIL", SignInemailaddress); //sets the email PlayerPrefs.SetString("PASS", SignInpass); //sets the pass StartCoroutine(IsInfoClosed()); AdventurePoint adp = (AdventurePoint)FindObjectOfType(typeof(AdventurePoint)); adp.enabled = true; }); } }