public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        SavableObjectInfo info = (SavableObjectInfo)target;

        GUI.enabled = isPrefab(info.gameObject);
        if (GUILayout.Button("Autoset (Prefab Only)"))
        {
            info.autoset();
            EditorUtility.SetDirty(info);
        }
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        ObjectInfo info = (ObjectInfo)target;

        GUI.enabled = isPrefab(info.gameObject);
        if (GUILayout.Button("Convert to SavableObjectInfo (Prefab Only)"))
        {
            GameObject go = info.gameObject;
            DestroyImmediate(info, true);
            SavableObjectInfo soi = go.AddComponent <SavableObjectInfo>();
            soi.autoset();
            EditorUtility.SetDirty(soi);
        }
    }