public MyEditorActionEntityCopy(List <MyEntity> actionEntities) : base(actionEntities, true) { ActionEntities.Clear(); SourceEntities = new List <MyEntity>(); SourceEntities.AddRange(actionEntities); AddChildren(); RemapEntityIdsOnInit(); }
/// <summary> /// Remove all action entities /// </summary> protected virtual void RemoveFromScene() { foreach (MyEntity actionEntity in ActionEntities) { //dont delete player ship if (actionEntity == MySession.PlayerShip) { continue; } MyEditorGizmo.RemoveEntityFromSelection(actionEntity); if (actionEntity == MyEditor.Static.GetEditedPrefabContainer()) { MyEditor.Static.ResetActivePrefabContainer(); } MyEditor.Static.DeleteEntityFromCollidingList(actionEntity); if (!(actionEntity is MyPrefabBase)) { if (m_activeContainer == null && MyEditor.Static.IsEditingPrefabContainer()) { MyEditor.Static.ExitActivePrefabContainer(); } } else { MyEditor.Static.EditPrefabContainer(m_activeContainer); } actionEntity.MarkForClose(); MyEditor.Static.RecheckAllColidingEntitesAndClearNonColiding(); } ActionEntities.Clear(); MyAudio.AddCue2D(MySoundCuesEnum.GuiEditorObjectDelete); }