Exemplo n.º 1
0
 private void SwitchPlayer()
 {
     if (_failed && _switched)
     {
         Utils.InvokeDelayed(() =>
         {
             _pc.Reset();
             Run(true);
         }, 1f);
         return;
     }
     if (_failed)
     {
         _switched = true;
     }
     if (_curPlayer == BattleLevel.Instance.Player)
     {
         _curComboText = EnemyComboText;
         _curPlayer    = BattleLevel.Instance.Enemy;
         _curAnim      = BattleLevel.Instance.EAnim;
         Utils.InvokeDelayed(() =>
         {
             _pc.Reset();
             Hide();
             HideComboText(PlayerComboText);
             Utils.InvokeDelayed(() =>
             {
                 CameraScript.Instance.FocusOn(new Vector3(_curPlayer.transform.position.x, 0, 0));
             }, 1f);
             Utils.InvokeDelayed(
                 () =>
             {
                 Run();
                 ShowComboText(EnemyComboText);
             }, 2f);
         }, 1f);
     }
     else
     {
         _curPlayer    = BattleLevel.Instance.Player;
         _curAnim      = BattleLevel.Instance.PAnim;
         _curComboText = PlayerComboText;
         Utils.InvokeDelayed(() =>
         {
             _pc.Reset();
             Hide();
             HideComboText(EnemyComboText);
             Utils.InvokeDelayed(() =>
             {
                 CameraScript.Instance.FocusOn(new Vector3(_curPlayer.transform.position.x, 0, 0));
             }, 1f);
             Utils.InvokeDelayed(
                 () =>
             {
                 Run();
                 ShowComboText(PlayerComboText);
             }, 2f);
         }, 1f);
     }
 }