Hello,
This has now been added in the “gear” context menu of a graph asset. If you want, you can add this now manually as well, by opening Editor_Graph.cs file and adding this code at the end:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[ContextMenu("Deep Duplicate")]
publicvoidDeepDuplicate(){
if(EditorUtility.DisplayDialog("Deep Duplicate","This will create a deep duplicate of this graph asset along with it's subgraphs. Continue?","Yes","No")){
DeepCopy(this);
}
}
///Make a deep copy of provided graph asset along with it's sub-graphs.
staticGraph DeepCopy(Graph root){
if(root==null){
returnnull;
}
varpath=EditorUtility.SaveFilePanelInProject("Duplicate of "+root.name,root.name+"_duplicate.asset","asset","");