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); }
/// <summary> /// sync from event of playerEntiy.BagSet.WeaponSlot Component /// </summary> /// <param name="entityKey"></param> internal void Sync(EntityKey entityKey) { entity = WeaponEntityFactory.GetWeaponEntity(WeaponContext, entityKey); }
private static WeaponEntity FindEmptyWeaponEntity(this PlayerEntity player) { return(WeaponEntityFactory.GetWeaponEntity(player.playerWeaponCustomize.EmptyConstWeaponkey)); }
private static WeaponEntity FindGrenadeWeaponEntity(this PlayerEntity player) { return(WeaponEntityFactory.GetWeaponEntity(player.playerWeaponCustomize.GrenadeConstWeaponKey)); }