コード例 #1
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
 }
コード例 #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>();
 }
コード例 #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>();
    }
コード例 #4
0
 void Awake()
 {
     recoil = GetComponent <WeaponRecoil>();
 }