Reflection issue since 5.2.3p3

One of our plugins from the asset store has a function like this

public PropertyInfo GetProperty(Type type, string name)
        {
            return type.GetProperty(name);
        }

type in this instance is a Unity Transform type. name is “eulerAngles”. This works in 5.2.3f1 but on 5.2.3p3 and 5.3+ it stopped working on WebGL and iOS. Instead “null” is returned. Is this a deliberate change in Unity does anyone know or a bug?

print(GetProperty(typeof(Transform), "eulerAngles"));

I mean typing this in using your method printed:
UnityEngine.Vector3 eulerAngles.

Seems fine in the inspector with WebGL selected as the build. Does the issue happen after you build the project? I’m using the latest 5.3 version of Unity.

Yes its only on the compiled project. Anything in the editor appears to work fine.

Hello,

can you try to use eulerAngles explicitly somewhere else in your code (ex: just put Debug.Log(transform.eulerAngles) in one of your Start methods), and than see if the reflection code works fine?

Thanks,
Gabriele

When I do that I get an ArgumentException “set method not found for ‘eulerAngles’”

OK if I do transform.eulerAngles = transform.eulerAngles it works. Bit of a hack but I suppose it will do :slight_smile: Thanks

Ok. When you have time, it will be very useful if you could open a bug with a small repro case of the issue, so we can look at it and solve it properly. In case you do, plz post here the case number so I can give it a quick look.