private void Awake() { if (!Instance) { Instance = this; } }
private void Awake() { _weaponAudio = GetComponent <WeaponAudio>(); _weaponStats = GetComponent <WeaponStats>(); if (_weaponStats == null) { Debug.LogError("No Weapon Stats!"); } _animator = GetComponent <Animator>(); if (_animator == null) { Debug.LogError("No Animator!"); } assignSecondaryFunction(); _weaponRecoil = GetComponent <WeaponRecoil>(); }
private void Awake() { clipContent = weaponStats.clipSize; m_AmmoRemaining = clipContent * (weaponStats.numberOfClips - 1); if (projectilePrefab != null) { int size = Mathf.Max(m_MimimumClipSize, weaponStats.clipSize) * advancedSettings.projectilePerShot; for (int i = 0; i < size; i++) { Projectile p = Instantiate(projectilePrefab); p.gameObject.SetActive(false); m_ProjectilePool.Enqueue(p); } } m_Animator = GetComponent <Animator>(); m_Source = GetComponent <AudioSource>(); m_WeaponRecoil = GetComponent <WeaponRecoil>(); }
void Awake() { recoil = GetComponent <WeaponRecoil>(); }