Beispiel #1
0
        public static EntityKey CreateCustomizeWeapon(EntityKey lastKey, EntityKey owner, int configId)
        {
            if (lastKey.IsValid())
            {
                WeaponEntity currWeapon = WeaponEntityFactory.GetWeaponEntity(lastKey);
                if (currWeapon != null)
                {
                    WeaponEntityFactory.RemoveWeaponEntity(currWeapon);
                }
            }
            WeaponEntity newWeapon = WeaponEntityFactory.CreateEntity(WeaponUtil.CreateScan(configId));

            newWeapon.SetRetain(owner);
            return(newWeapon.entityKey.Value);
        }
Beispiel #2
0
 /// <summary>
 /// sync from event of playerEntiy.BagSet.WeaponSlot Component
 /// </summary>
 /// <param name="entityKey"></param>
 internal void Sync(EntityKey entityKey)
 {
     entity = WeaponEntityFactory.GetWeaponEntity(WeaponContext, entityKey);
 }
Beispiel #3
0
 private static WeaponEntity FindEmptyWeaponEntity(this PlayerEntity player)
 {
     return(WeaponEntityFactory.GetWeaponEntity(player.playerWeaponCustomize.EmptyConstWeaponkey));
 }
Beispiel #4
0
 private static WeaponEntity FindGrenadeWeaponEntity(this PlayerEntity player)
 {
     return(WeaponEntityFactory.GetWeaponEntity(player.playerWeaponCustomize.GrenadeConstWeaponKey));
 }