private void DrawGUIToolBar()
{
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar)) {
if (GUILayout.Button(new GUIContent("Refresh", reloadButtonTexture.image, "Refresh and reload"), EditorStyles.toolbarButton, GUILayout.Width(80), GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT))) {
Setup(ActiveBuildTarget);
}
showErrors = GUILayout.Toggle(showErrors, "Show Error", EditorStyles.toolbarButton, GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT));
GUILayout.FlexibleSpace();
if(isAnyIssueFound) {
GUIStyle errorStyle = new GUIStyle("ErrorLabel");
errorStyle.alignment = TextAnchor.MiddleCenter;
GUILayout.Label("All errors needs to be fixed before building", errorStyle);
GUILayout.FlexibleSpace();
}
GUIStyle tbLabel = new GUIStyle(EditorStyles.toolbar);
tbLabel.alignment = TextAnchor.MiddleCenter;
GUIStyle tbLabelTarget = new GUIStyle(tbLabel);
tbLabelTarget.fontStyle = FontStyle.Bold;
GUILayout.Label("Platform:", tbLabel, GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT));
// GUILayout.Label(BuildTargetUtility.TargetToHumaneString(ActiveBuildTarget), tbLabelTarget, GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT));
var supportedTargets = NodeGUIUtility.SupportedBuildTargets;
int currentIndex = Mathf.Max(0, supportedTargets.FindIndex(t => t == selectedTarget));
int newIndex = EditorGUILayout.Popup(currentIndex, NodeGUIUtility.supportedBuildTargetNames,
EditorStyles.toolbarButton, GUILayout.Width(150), GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT));
if(newIndex != currentIndex) {
selectedTarget = supportedTargets[newIndex];
Setup(ActiveBuildTarget);
}
using(new EditorGUI.DisabledScope(isAnyIssueFound)) {
if (GUILayout.Button("Build", EditorStyles.toolbarButton, GUILayout.Height(AssetBundleGraphGUISettings.TOOLBAR_HEIGHT))) {
SaveGraph();
Run(ActiveBuildTarget);
}
}
}
}