- Home /
Question by
Shibli · Aug 01, 2017 at 09:46 AM ·
arrayeditor-scriptingstructcopy-paste
PropertyDrawer Copy Paste values from array of structs
Hey, I'm trying to copy array values from a Gameobject to a Scriptable object. The problem is that right clicking on an array element does not allow me to copy the value and paste it into another array.
Is this possible with a custom propertydrawer for the struct? I have seen examples with a custom inspector but I want to use a property drawer because the actual struct i'm using ( the one in the screen shot is a simplified example) is very complicated as it holds the definition for a wave of enemies in a game.
Sample Struct
[System.Serializable]
public struct StructDef
{
public int x;
public int y;
public int z;
}
Sample ScriptableObject
public class StructScriptableObject : ScriptableObject {
public StructDef[] defs;
}
Sample GameObject
public class StructGo : MonoBehaviour {
public StructDef[] defs;
}
capture2.png
(38.3 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612131646im_/https://answers.unity.com/themes/thub/images/avi.jpg)