Exemple #1
0
 public float TryFireWeapon()
 {
     if (m_weaponAsset && Time.time > m_timeForNextFire)
     {
         m_weaponAsset.Fire(transform, m_faction);
         m_timeForNextFire = Time.time + m_weaponAsset.Interval();
     }
     return(m_timeForNextFire);
 }
Exemple #2
0
 public void EquipNewWeapon(WeaponAsset weaponAsset)
 {
     m_weaponAsset = weaponAsset;
     if (m_weaponAsset)
     {
         m_weaponAsset.PoolAmmoAndFX(m_pool);
         m_timeForNextFire = m_weaponAsset.Interval();
         m_isLoaded        = true;
     }
     else
     {
         Debug.Log("no weapon asset to equip");
     }
 }