Copies the selected objects.
()
| 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> |
nothing calls this directly
no test coverage detected