コード例 #1
0
    IEnumerator EnemeyAttackRoutin(int attackRate)
    {
        while (_isEnemyDead == false)
        {
            yield return(new WaitForSeconds(attackRate));

            if (_player.isPlayerDead == false)
            {
                _animator.SetTrigger("Attack1Trigger");
                _player.TakeDame(_localUser.currentDefenderScore + 100);//Enemy Attach damage Rate
            }
            else
            {
                if (_isEnemyDead != true)
                {
                    FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, false, _localUser.currentMutex);
                    StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
                    _uIManagerFight.DisplayEndPanel(false);//player lost show panel
                    break;
                }
            }

            print(_player.isPlayerDead);
        }
    }
コード例 #2
0
 private void TakeDame(int damge)
 {
     if (_enemyCurrentHealth > 0)
     {
         _enemyCurrentHealth = _enemyCurrentHealth - damge;
         _healthBar.SetHealth(_enemyCurrentHealth);
     }
     else
     {
         _enemyCurrentHealth = 0;
         _isEnemyDead        = true;
         FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, true, _localUser.currentMutex);
         StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
         _uIManagerFight.DisplayEndPanel(true);//player won show panel
     }
 }
コード例 #3
0
    public void OnExitButtonClick()
    {
        FightSet fightSet = new FightSet(_localUser.currentEventId, _localUser.userID, false, _localUser.currentMutex);

        StartCoroutine(_gameNetwork.SetFightSatus("https://harryspotter.eu.ngrok.io/setFightStatus", fightSet.Serialize().ToString()));
        SceneManager.LoadScene("Map");
    }