Quantcast
Channel: Latest Questions by vptb
Viewing all articles
Browse latest Browse all 18

SerializedProperty to Texture2D

$
0
0
I'm currently making a custom propertydrawer, and I want to draw a preview of a sprite field. So the question is pretty simple let's say I have this SerializedProperty: property.FindPropertyRelative("Sprite") How do I convert this into a Texture2D? SerializedProperty doesn't have any property method that returns a Texture or Texture2D. I tried using the "objectReferenceValue" and then cast to Texture, but with no success. If someone was able to make this, please enlighten me. Thank you.

Viewing all articles
Browse latest Browse all 18

Trending Articles



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