MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Copy

Method Copy

Source/Editor/Modules/SceneEditingModule.cs:503–521  ·  view source on GitHub ↗

Copies the selected objects.

()

Source from the content-addressed store, hash-verified

501 /// Copies the selected objects.
502 /// </summary>
503 public void Copy()
504 {
505 // Peek things that can be copied (copy all actors)
506 var objects = Selection.Where(x => x.CanCopyPaste).ToList().BuildAllNodes().Where(x => x.CanCopyPaste && x is ActorNode).ToList();
507 if (objects.Count == 0)
508 return;
509
510 // Serialize actors
511 var actors = objects.ConvertAll(x => ((ActorNode)x).Actor);
512 var data = Actor.ToBytes(actors.ToArray());
513 if (data == null)
514 {
515 Editor.LogError("Failed to copy actors data.");
516 return;
517 }
518
519 // Copy data
520 Clipboard.RawData = data;
521 }
522
523
524 /// <summary>

Callers

nothing calls this directly

Calls 5

WhereMethod · 0.80
BuildAllNodesMethod · 0.80
ToBytesMethod · 0.80
ToArrayMethod · 0.45
LogErrorMethod · 0.45

Tested by

no test coverage detected