浏览代码

Some UI polish

/main
Mohsen Kamalzadeh 4 年前
当前提交
9f6fae37
共有 1 个文件被更改,包括 37 次插入11 次删除
  1. 48
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs

48
com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs


PerceptionCamera perceptionCamera => ((PerceptionCamera)this.target);
string m_PreviousOutputDir;
bool showPatchChangedLabel = false;
public void OnEnable()
{
m_LabelersList = new ReorderableList(this.serializedObject, labelersProperty, true, true, true, true);

}
var dir = PlayerPrefs.GetString(SimulationState.latestOutputDirectoryKey, string.Empty);
m_PreviousOutputDir = dir;
EditorGUILayout.LabelField("Latest Output Folder");
EditorGUILayout.LabelField("Latest Dataset");
if (GUILayout.Button("Choose Base Folder"))
{
var path = EditorUtility.OpenFolderPanel("Choose Base Folder", "", "");
if (path.Length != 0)
{
Debug.Log($"Chose path: {path}");
PlayerPrefs.SetString(SimulationState.userBaseDirectoryKey, path);
PlayerPrefs.SetString(SimulationState.latestOutputDirectoryKey, path);
}
}
if (GUILayout.Button("Show Folder"))
{
EditorUtility.RevealInFinder(dir);

GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
GUILayout.Space(10);
if (GUILayout.Button("Choose Output Folder"))
{
var path = EditorUtility.OpenFolderPanel("Choose Output Folder", "", "");
if (path.Length != 0)
{
Debug.Log($"Chose path: {path}");
PlayerPrefs.SetString(SimulationState.userBaseDirectoryKey, path);
showPatchChangedLabel = true;
}
}
if (showPatchChangedLabel)
{
if (m_PreviousOutputDir == dir)
{
var s = new GUIStyle(EditorStyles.textField);
s.normal.textColor = Color.green;
s.wordWrap = true;
EditorGUILayout.LabelField("Output folder changed to: ");
EditorGUILayout.LabelField($"{PlayerPrefs.GetString(SimulationState.userBaseDirectoryKey)}", s);
}
else
{
showPatchChangedLabel = false;
}
}
if (EditorSettings.asyncShaderCompilation)
{

正在加载...
取消
保存