mardi 3 septembre 2019

Unity Player throws excpetion: System.ArgumentException: Get Method not found for 'hideFlags'

So i have a ComponenetCopier script that, what a suprise copies scripts.

The problem is that it does not work when i build my game, it jsut drops the following error and aborts the process, with the following exception:

System.ArgumentException: Get Method not found for 'hideFlags' at System.Reflection.MonoProperty

The code where it dies is here:

PropertyInfo[] properties = type.GetProperties();
Debug.Log("Do i die here?");
foreach (PropertyInfo property in properties)
{
     property.SetValue(myNew_Component, property.GetValue(original, null), null);
}

I have no idea why it fails, when it works in editor mode, but this kinda bugs me for days now. Help is greatly appreciated...

Ps: I'm copying my components using reflection.





Aucun commentaire:

Enregistrer un commentaire