コード例 #1
0
ファイル: Level.cs プロジェクト: SteveDunn/oglr
        public void MoveSelectedIditorsToLayer(LayerEditor chosenLayer)
        {
            var selected = SelectedEditors.ToList(  );

            foreach (var eachSelectedEditor in selected)
            {
                ActiveLayer.RemoveEditor(eachSelectedEditor);

                eachSelectedEditor.ParentLayer = chosenLayer;

                chosenLayer.AddEditor(eachSelectedEditor);
            }
        }
コード例 #2
0
ファイル: Level.cs プロジェクト: SteveDunn/oglr
        public IEnumerable <ItemEditor> CopySelectedEditorsToLayer(LayerEditor destinationLayer)
        {
            var selectedEditors = SelectedEditors.ToList(  );

            foreach (ItemEditor eachEditor in selectedEditors)
            {
                ItemEditor clonedEditor = eachEditor.Clone( );

                clonedEditor.ParentLayer         = destinationLayer;
                clonedEditor.ItemProperties.Name = destinationLayer.ParentLevel.GetUniqueNameBasedOn(clonedEditor.ItemProperties.Name);

                destinationLayer.AddEditor(clonedEditor);

                clonedEditor.ItemProperties.Id = generateId( );

                yield return(clonedEditor);
            }
        }