Пример #1
0
		public override void OnInspectorGUI()
		{
			if (_geoSync == null)
			{
				AcquireTarget();
			}

			using (new EditorGUILayout.VerticalScope())
			{
				bool bSyncing = _geoSync.IsSyncing;

				EditorGUILayout.LabelField(_fileLabelContent);

				using (new EditorGUILayout.HorizontalScope())
				{
					_geoSync._filePath = EditorGUILayout.DelayedTextField(_geoSync._filePath);

					// TODO: add field for output cache directory

					GUIStyle buttonStyle = HEU_EditorUI.GetNewButtonStyle_MarginPadding(0, 0);
					if (GUILayout.Button("...", buttonStyle, GUILayout.Width(30), GUILayout.Height(18)))
					{
						string filePattern = "*.bgeo;*.bgeo.sc";
						_geoSync._filePath = EditorUtility.OpenFilePanel("Select File", _geoSync._filePath, filePattern);
					}
				}

				HEU_EditorUI.DrawSeparator();

				if (bSyncing)
				{
					EditorGUILayout.LabelField(_statusSyncContent);

					if (GUILayout.Button(_stopContent))
					{
						_geoSync.StopSync();
					}
				}
				else
				{
					EditorGUILayout.LabelField(_statusIdleContent);

					using (new EditorGUILayout.HorizontalScope())
					{
						bool bLoaded = _geoSync.IsLoaded();

						if (GUILayout.Button(_syncContent))
						{
							_geoSync.StartSync();
						}

						//GUILayout.FlexibleSpace();

						using (new EditorGUI.DisabledScope(!bLoaded))
						{
							if (GUILayout.Button(_unloadContent))
							{
								_geoSync.Unload();
							}
						}
					}
				}

				if (!string.IsNullOrEmpty(_geoSync._logStr))
				{
					EditorGUILayout.LabelField("Log: " + _geoSync._logStr);
				}
			}
		}