浏览代码

Use CustomBaseEditor class in GameSceneSOEditor.cs

/main
rainaldisatria 4 年前
当前提交
0cc94ef8
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 9
      UOP1_Project/Assets/Scripts/Editor/GameSceneSOEditor.cs

9
UOP1_Project/Assets/Scripts/Editor/GameSceneSOEditor.cs


using UnityEngine.SceneManagement;
[CustomEditor(typeof(GameSceneSO), true)]
public class GameSceneSOEditor : Editor
public class GameSceneSOEditor : CustomBaseEditor
{
private const string NO_SCENES_WARNING = "There is no Scene associated to this location yet. Add a new scene with the dropdown below";
private GUIStyle _headerLabelStyle;

public override void OnInspectorGUI()
{
//Make GUI not editable.
GUI.enabled = false;
//Draw reference information about script being edited.
EditorGUILayout.ObjectField("Script", MonoScript.FromScriptableObject((GameSceneSO)target), typeof(GameSceneSO), false);
//Make GUI editable.
GUI.enabled = true;
DrawNonEdtiableScriptReference<GameSceneSO>();
serializedObject.Update();
EditorGUILayout.LabelField("Scene information", _headerLabelStyle);

正在加载...
取消
保存