Пример #1
0
 public static void AddOwner(this WeaponEntity weaponEntity, EntityKey entityKey)
 {
     if (!weaponEntity.hasOwnerId)
     {
         weaponEntity.AddOwnerId(entityKey);
     }
     else
     {
         weaponEntity.ownerId.Value = entityKey;
     }
     weaponEntity.isFlagSyncSelf = true;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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);
     }
 }