Beispiel #1
0
    public void Check()
    {
        var res = _pc.CheckPointer();
        var c   = Color.white;

        switch (res)
        {
        case 0:
            StartCoroutine(ShakeBar());
            BattleState = BattleState.Stopped;
            _pc.StopMoving();
            if (!_failed)
            {
                _failed = true;
            }
            else
            {
//                    Winner.gameObject.SetActive(true);
                Results.Run();
                Hide();
                HideComboText(_curComboText);
                TapBtn.SetActive(false);
                return;
            }
//                Scores.ScoreEnemy = UnityEngine.Random.Range(4, 8);
//                EnemyComboText.text = "x" + Scores.ScoreEnemy;
//                EnemyComboText.transform.rotation =
//                    Quaternion.AngleAxis(UnityEngine.Random.Range(-25, 25), Vector3.forward);
            break;

        case 1:
            var pos = Camera.main.ScreenToWorldPoint(_pc.transform.position);
            Effects.ExplosionEffect(pos);
            if (UnityEngine.Random.value > 0.5f || true)
            {
                Effects.HeartsEffect(_curPlayer.transform.position, 2);
            }
            AddCombo();
            if (BattleLevel.Instance.PAnim.Jump())
            {
                _curAnim.SetFace(EyeType.Right1, NoseType.Nose3);
            }
            if (BattleLevel.Instance.EAnim.Jump())
            {
                _curAnim.SetFace(EyeType.Right1, NoseType.Nose3);
            }
            break;
        }
        CutSubscale(_pc.transform.position.x);
        _pc.StopMoving();
        BattleState = BattleState.Stopped;
        SwitchPlayer();
    }