Unity copy/paste system?

Hi all :slight_smile:

I got a list of complex structs ( with string, gameObject, bools, vectors etc… )

I also wrote a customeditor for editing every member of those structs elements.
Now i’d like to add a button to copy an element and another button to paste element.

Is there in unity3D a copy/paste system ( i guess yes as it can be done in standard inspectors ) ?

If yes could you please explain roughly how to do this ? :slight_smile:

Thanks and happy unitying !

Unity hasn’t given us access to their internal copy-paste system - but you can still achieve what you’re after quite easily using these three methods:

  1. JsonUtility.ToJson
  2. GUIUtility.systemCopyBuffer
  3. JsonUtility.FromJson
1 Like