Exemplo n.º 1
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
 }
Exemplo n.º 2
0
 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>();
 }
Exemplo n.º 3
0
    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>();
    }
Exemplo n.º 4
0
 void Awake()
 {
     recoil = GetComponent <WeaponRecoil>();
 }