protected void Awake()
 {
     item   = this.GetComponent <Item>();
     module = item.data.GetModule <Shared.AmmoModule>();
     DisableCulling(item);
     holder          = item.GetComponentInChildren <Holder>();
     holder.Snapped += new Holder.HolderDelegate(this.OnAmmoItemInserted);
     magazineHandle  = item.GetCustomReference(module.handleRef).GetComponent <Handle>();
     bulletMesh      = item.GetCustomReference(module.bulletMeshRef).gameObject;
     RefillAll();
 }
 protected void Awake()
 {
     item              = this.GetComponent <Item>();
     module            = item.data.GetModule <Shared.AmmoModule>();
     holder            = item.GetComponentInChildren <Holder>();
     holder.UnSnapped += new Holder.HolderDelegate(this.OnWeaponItemRemoved);
     if (module.ammoCapacity > 0)
     {
         usesRemaining = module.ammoCapacity; infiniteUses = false;
     }
     else
     {
         infiniteUses = true;
     }
     return;
 }
コード例 #3
0
 protected void Awake()
 {
     item   = this.GetComponent <Item>();
     module = item.data.GetModule <Shared.AmmoModule>();
     DisableCulling(item);
     thisAmmoType = module.GetSelectedType();
     capacity     = module.ammoCapacity;
     if (module.handleRef != null)
     {
         ammoHandle = item.GetCustomReference(module.handleRef).GetComponent <Handle>();
     }
     if (module.bulletMeshRef != null)
     {
         bulletMesh = item.GetCustomReference(module.bulletMeshRef).gameObject;
     }
     Refill();
 }