public static void AddOwner(this WeaponEntity weaponEntity, EntityKey entityKey) { if (!weaponEntity.hasOwnerId) { weaponEntity.AddOwnerId(entityKey); } else { weaponEntity.ownerId.Value = entityKey; } weaponEntity.isFlagSyncSelf = true; }
internal static void SetFlagHasOwnwer(this WeaponEntity weaponEntity, EntityKey entityKey) { if (!weaponEntity.hasOwnerId) { weaponEntity.AddOwnerId(entityKey); } else { weaponEntity.ownerId.Value = entityKey; } weaponEntity.isFlagSyncSelf = true; weaponEntity.isFlagDestroy = false; }
public static void SetRetain(this WeaponEntity weaponEntity, EntityKey owner) { if (!owner.IsValid()) { return; } weaponEntity.isFlagSyncSelf = true; weaponEntity.isFlagSyncNonSelf = false; if (weaponEntity.hasOwnerId) { weaponEntity.ownerId.Value = owner; } else { weaponEntity.AddOwnerId(owner); } }