private void Start() { gunRecoiler = GetComponentInParent <Recoiler>(); camRecoiler = FPSCamera.GetComponentInParent <Recoiler>(); gunData.currentAmmo = gunData.magazineCapacity; if (audioSource == null) { audioSource = gameObject.AddComponent <AudioSource>(); } bulletHitController = GetComponent <BulletHitController>(); }
private void Start() { // Recolier components references from gun and camera GUNRecoiler = GetComponentInParent <Recoiler>(); CAMRecoiler = FPSCAMERA.GetComponentInParent <Recoiler>(); gunData.currentAmmo = gunData.magazineCapacity; if (audioSource == null) { audioSource = gameObject.AddComponent <AudioSource>(); } bulletHitController = GetComponent <BulletHitController>(); }