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.
↧