|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|