static void RemoveFloating_Impelentation()
 {
     if (!MyEventContext.Current.IsLocallyInvoked && !MySession.Static.HasPlayerAdminRights(MyEventContext.Current.Sender.Value))
     {
         MyEventContext.ValidationFailed();
         return;
     }
     foreach (var entity in MyEntities.GetEntities())
     {
         MyFloatingObject floating = entity as MyFloatingObject;
         if (floating != null)
         {
             floating.SendCloseRequest();
         }
     }
 }
Пример #2
0
 private void OnRemoveFloating(MyGuiControlButton obj)
 {
     foreach (var entity in MyEntities.GetEntities())
     {
         MyFloatingObject floating = entity as MyFloatingObject;
         if (floating != null)
         {
             if (Sync.IsServer)
             {
                 floating.Close();
             }
             else
             {
                 floating.SendCloseRequest();
             }
         }
     }
 }