public override void OnPreviewGUI(Rect r, GUIStyle background) { GUI.Label(r, target.name + " is being previewed"); NodeMeshGenerator generator = target as NodeMeshGenerator; if (generator.Asset == null) { return; } PreviewUtils.DrawMeshPreview(_previewRenderUtility, r, r, generator.Asset); }
public void Init(Object obj, UnityAction action) { title.text = obj.name; preview.sprite = PreviewUtils.LoadPreview(obj); button.onClick.AddListener(action); }