Quantcast
Channel: Questions in topic: "class instance"
Viewing all articles
Browse latest Browse all 131

Convert SerializedProperty to Custom Class

$
0
0
Hi, I struggling with SerilizedProperty. Let's say I have class [System.Serializable] public class ItemRandom { public bool test = false; public int test2 = 4; } And I want to save them like preset in a list of ScriptableObject [System.Serializable] public class PresetHolder : ScriptableObject { public List randomPresets = new List (); public void AddRandomPreset (SerializedProperty random) { -- How can I had to the list the random property as ItemRandom type } } How can I convert a SerializeProperty in a custom class ? I looked everywhere, the only thing I found is maybe to derived the class from ScriptableObject to and create instances of them, but I would like to avoid that... Thanks

Viewing all articles
Browse latest Browse all 131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>