For some reason when I try to drag and drop my prefab into the object field it doesn’t stick. I’m not sure where I’m going wrong. Maybe it’s just a simple mistake. Thanks in advance.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class FracObject : MonoBehaviour {
public GameObject go;
}
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(FracObject))]
public class FracOjectEditor : Editor {
SerializedProperty goprop;
private void OnEnable()
{
goprop = serializedObject.FindProperty("go");
}
public override void OnInspectorGUI()
{
goprop.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Source", "Add object to fracture"), goprop.objectReferenceValue, typeof(GameObject), false);
}
}