Пример #1
0
    private IEnumerator ThrowRock()
    {
        yield return(new WaitForSeconds(rockThrowDelay));

        holding             = false;
        rockBody.useGravity = true;
        rockBody.AddForce(transform.forward * throwSpeed, ForceMode.Acceleration); //changed to acceleration to add force independent of mass
        pAudioManager.PlayThrowSound();

        //Enable collider again
        yield return(new WaitForSeconds(.1f));

        rockBody.GetComponent <Collider>().enabled = true;
    }