コード例 #1
0
		private static void DestroyWorkItemResultData(HEU_TOPNodeData topNode, HEU_TOPWorkResult result)
		{
			if (result._generatedGOs != null)
			{
				int numGOs = result._generatedGOs.Count;
				for (int i = 0; i < numGOs; ++i)
				{
					HEU_GeoSync geoSync = result._generatedGOs[i].GetComponent<HEU_GeoSync>();
					if (geoSync != null)
					{
						geoSync.Unload();
					}

					//Debug.LogFormat("Destroy result: " + result._generatedGOs[i].name);
					HEU_GeneralUtility.DestroyImmediate(result._generatedGOs[i]);
					result._generatedGOs[i] = null;
				}

				result._generatedGOs.Clear();
			}
		}
コード例 #2
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);
				}
			}
		}