Exemple #1
0
 public override void OnInspectorGUI()
 {
     serializedObject.UpdateIfRequiredOrScript();
     EditorGUI.BeginChangeCheck();
     EditorGUILayout.PropertyField(_ID, new GUIContent("识别码"));
     sceneSelector.DoLayoutDraw();
     EditorGUILayout.PropertyField(positions, new GUIContent("位置表"));
     if (target is CheckPointInformation)
     {
         DrawCheckPoint();
     }
     if (EditorGUI.EndChangeCheck())
     {
         serializedObject.ApplyModifiedProperties();
     }
 }
Exemple #2
0
 void DrawNPCInfo()
 {
     if (talker)
     {
         DrawTalkerInfo();
     }
     else
     {
         serializedObject.UpdateIfRequiredOrScript();
         EditorGUI.BeginChangeCheck();
         bool enableBef = enable.boolValue;
         EditorGUILayout.PropertyField(enable, new GUIContent("启用", "若启用,将在场景中生成实体"));
         EditorGUILayout.PropertyField(_ID, new GUIContent("识别码"));
         if (string.IsNullOrEmpty(_ID.stringValue) || ExistsID())
         {
             if (!string.IsNullOrEmpty(_ID.stringValue) && ExistsID())
             {
                 EditorGUILayout.HelpBox("此识别码已存在!", MessageType.Error);
             }
             else
             {
                 EditorGUILayout.HelpBox("识别码为空!", MessageType.Error);
             }
             if (GUILayout.Button("自动生成识别码"))
             {
                 _ID.stringValue = GetAutoID();
                 EditorGUI.FocusTextInControl(null);
             }
         }
         EditorGUILayout.PropertyField(_name, new GUIContent("名称"));
         EditorGUILayout.PropertyField(sex, new GUIContent("性别"));
         if (enable.boolValue)
         {
             sceneSelector.DoLayoutDraw();
             EditorGUILayout.PropertyField(position, new GUIContent("位置"));
             EditorGUILayout.PropertyField(prefab, new GUIContent("预制件"));
             EditorGUILayout.PropertyField(SMParams, new GUIContent("状态机参数"));
         }
         if (EditorGUI.EndChangeCheck())
         {
             serializedObject.ApplyModifiedProperties();
         }
     }
 }