private void CreateGUI()
{
AssetUpdater updater = AssetUpdater.Instance;
_gui = new GUIVertical();
GUIScrollView scrollView = _gui.Add( new GUIScrollView()) as GUIScrollView;
scrollView.Add( new GUILabel( new GUIContent( "Installed Assets")));
GUIStyle style = EditorGUIUtility.isProSkin ? CreateBackgroundStyle( 55, 70) :
CreateBackgroundStyle( 170, 235);
_assetUpdateLabels = new List<GUILabel>();
_downloadButtons = new List<GUIButton>();
GUIStyle statusStyle = new GUIStyle();
statusStyle.margin = new RectOffset( 2, 4, 2, 2);
statusStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color( 0.6f, 0.6f, 0.6f) :
new Color( 0.4f, 0.4f, 0.4f);
statusStyle.alignment = TextAnchor.MiddleRight;
int count = updater.AssetCount;
for( int i=0; i<count; i++)
{
AssetVersion localVersion = updater.GetLocalVersion( i);
AssetVersion remoteVersion = updater.GetRemoteVersion( i);
GUIHorizontal bar = scrollView.Add( new GUIHorizontal( style)) as GUIHorizontal;
GUIVertical infoContainer = bar.Add( new GUIVertical()) as GUIVertical;
infoContainer.Add( new GUILabel( new GUIContent( localVersion.Name + " (" + localVersion.Version + ")")));
infoContainer.Add( new GUILabel( new GUIContent( localVersion.Author)));
string labelText = UpdateTextForVersion( localVersion, remoteVersion);
GUIVertical updateContainer = bar.Add( new GUIVertical()) as GUIVertical;
GUILabel label = updateContainer.Add( new GUILabel( new GUIContent( labelText))) as GUILabel;
label.style = statusStyle;
GUIHorizontal buttonsContainer = updateContainer.Add( new GUIHorizontal()) as GUIHorizontal;
GUIButton button = buttonsContainer.Add( new GUIButton( new GUIContent( "Release Notes"),
ReleaseNotesButtonPressed)) as GUIButton;
button.tag = i;
button = buttonsContainer.Add( new GUIButton( new GUIContent( "Download"),
DownloadButtonPressed)) as GUIButton;
button.tag = i;
button.isHidden = remoteVersion == null ||
(localVersion.Version < remoteVersion.Version) == false;
_assetUpdateLabels.Add( label);
_downloadButtons.Add( button);
}
GUIHorizontal refreshContainer = scrollView.Add( new GUIHorizontal()) as GUIHorizontal;
refreshContainer.Add( new GUISpace( true));
refreshContainer.Add( new GUIButton( new GUIContent( "Refresh"), RefreshButtonPressed));
}