Quantcast
Viewing all articles
Browse latest Browse all 16

Get RangeAttributes from built in class using Reflection

I am working on an in game GUI for editing parameters of the built in audio filters. Using reflection, I was able to get the values of these parameters, but I am struggling to get the RangeAttributes that bound these parameters in the inspector. This is the code I have been using, however, it has only been returning null. System.Reflection.PropertyInfo[] fields = effectType.GetProperties(); foreach(System.Reflection.PropertyInfo pi in fields){ Debug.Log(RangeAttribute.GetCustomAttribute(pi, typeof(RangeAttribute))); } Is it possible to retrieve these range attributes from built in classes? Am I just going about it the wrong way? I could hand code the GUI for each filter as an alternative, but wheres the fun in that :)

Viewing all articles
Browse latest Browse all 16

Trending Articles



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