Quantcast
Channel: Answers for "Editor Wizard: Copy Existing Components to Another GameObject"
Viewing all articles
Browse latest Browse all 8

Answer by DR9885

$
0
0
To add to that Reflection suggestion, if you are using private serialized variables, like me, you may want something more like this... foreach (FieldInfo info in comp.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.NonPublic)) if(info.IsPublic || info.GetCustomAttributes(typeof(SerializeField),true).Length != 0); info.SetValue(newComponent, info.GetValue(comp));

Viewing all articles
Browse latest Browse all 8

Trending Articles



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