Пример #1
0
    void FireOneShot()
    {
        timer = fireRate;
        anim.Rewind(fireAnim.name);
        anim.Play(fireAnim.name);
        localSource.clip = fireSound;
        localSource.PlayOneShot(fireSound);
        StartCoroutine(MuzzleFlash());
        StartCoroutine(Kick3(camKB, new Vector3(-Random.Range(minKB, maxKB), Random.Range(minKBSide, maxKBSide), 0), 0.1f));
        StartCoroutine(Kick3(wepKB, new Vector3(-Random.Range(minKB, maxKB), Random.Range(minKBSide, maxKBSide), 0), 0.1f));
        pa.GetComponent <NetworkView>().RPC("FireAnim", RPCMode.Others);
        RaycastHit hit2;

        if (Physics.Raycast(bulletGo.position, bulletGo.forward, out hit2, range, hitLayers))
        {
            OnHit(hit2);
        }
        bulletsLeft--;
    }