- Home /
Question by
TheBikupan · Sep 02, 2014 at 10:53 AM ·
editoreditor-scriptingresourcesguilayoutgetassetpreview
Custom Inspector button texture?
I've been experimenting for a while wanting to display some buttons as icons in my custom inspector, but the best I can do is making the button blank.
Texture2D moveup = AssetPreview.GetAssetPreview (Resources.Load ("moveup.png"));
...
if (GUILayout.Button (moveup))
{
}
Comment
Best Answer
Answer by Gizmoi · Sep 02, 2014 at 02:48 PM
I suspect 'moveup' is null. Try removing ".png" from your path name. Objects loaded from resources should be loaded using the name as it appears in the Project View.