BS 0.1 基础构建完成 / 0.2 Visual 同为Unity UI控件部分
This commit is contained in:
50
Convention/[ES3]/Easy Save 3/Editor/ES3PrefabEditor.cs
Normal file
50
Convention/[ES3]/Easy Save 3/Editor/ES3PrefabEditor.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using ES3Internal;
|
||||
|
||||
[CustomEditor(typeof(ES3Prefab))]
|
||||
[System.Serializable]
|
||||
public class ES3PrefabEditor : Editor
|
||||
{
|
||||
bool showAdvanced = false;
|
||||
bool openLocalRefs = false;
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var es3Prefab = (ES3Prefab)serializedObject.targetObject;
|
||||
EditorGUILayout.HelpBox("Easy Save is enabled for this prefab, and can be saved and loaded with the ES3 methods.", MessageType.None);
|
||||
|
||||
|
||||
showAdvanced = EditorGUILayout.Foldout(showAdvanced, "Advanced Settings");
|
||||
if(showAdvanced)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
es3Prefab.prefabId = EditorGUILayout.LongField("Prefab ID", es3Prefab.prefabId);
|
||||
EditorGUILayout.LabelField("Reference count", es3Prefab.localRefs.Count.ToString());
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
openLocalRefs = EditorGUILayout.Foldout(openLocalRefs, "localRefs");
|
||||
if (openLocalRefs)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
EditorGUILayout.LabelField("It is not recommended to manually modify these.");
|
||||
|
||||
foreach (var kvp in es3Prefab.localRefs)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
EditorGUILayout.ObjectField(kvp.Key, typeof(UnityEngine.Object), false);
|
||||
EditorGUILayout.LongField(kvp.Value);
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user