Ejemplo n.º 1
0
    private void HandlePullAndShoot()
    {
        _strikeInput.onShoot += force =>
        {
            if (_player.Striked)
            {
                return;
            }
            if (!_player.HasTurn)
            {
                return;
            }
            if (striker.IsMoving())
            {
                return;
            }

            striker.Shoot(force);
            _player.Striked = true;
            StartCoroutine(CheckIfStrikerIsMoving());
        };
    }
Ejemplo n.º 2
0
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //Shoots current playing object in the direction of touch
    internal void Shoot(Vector3 touchedPosition)
    {
        if (strikerScript == null || strikerScript.isBusy || iTween.tweens.Count > 1)
        {
            return;
        }
        if (touchedPosition.y < thresoldLineTransform.position.y)
        {
            return;
        }
        if (LevelManager.instance.running())
        {
            AudioManager.instance.PlayFxSound(AudioManager.instance.shootingSound);

            Vector3 dir = (touchedPosition - currentStrikerPosition.position).normalized;
            strikerScript.Shoot(new Vector3(-dir.x, dir.y, 0.0f));

            if (nextStrikerObject != null)
            {
                iTween.MoveTo(nextStrikerObject.gameObject, currentStrikerPosition.position, .4f);
            }
        }
    }