예제 #1
0
    private void Fire()
    {
        isAiming = false;

        lineRenderer.enabled = false;

        currentBall = cannonBallPool.Recycle();         // GameObject.Instantiate(cannonBallPrefab, transform.position, transform.rotation).GetComponent<CannonBall>();
        currentBall.transform.position   = transform.position;
        currentBall.transform.rotation   = transform.rotation;
        currentBall.transform.localScale = transform.localScale;

        currentBall.Pool = cannonBallPool;

        currentBall.SetTrajectory(initialVelocity, horizontalForce);

        isReady = false;

        activateScoreSystemEvent.Raise(this);

        StartCoroutine(Cooldown());
    }