private void DrawSceneDetail(SceneDetail _sc) { var asset = AssetDatabase.LoadAssetAtPath <SceneAsset>(TGPaths.FullScenePath(_sc.sceneName)); if (asset == null) { EditorGUILayout.HelpBox("Please make sure scene has saved to Assets/_Projects/Scenes Directory", MessageType.Warning); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.ObjectField(asset, typeof(SceneAsset), false, GUILayout.Width(350), GUILayout.MinWidth(150)); EditorGUILayout.LabelField(_sc.deviceType, GUILayout.Width(100)); EditorGUILayout.EndHorizontal(); }
// 清理没用的场景 private void ClearNullScene() { var sceneDatas = m_settingData.sceneDatas; for (int i = sceneDatas.Count - 1; i >= 0; i--) { var sceneDetails = sceneDatas[i].sceneDetails; for (int j = sceneDetails.Count - 1; j >= 0; j--) { var asset = AssetDatabase.LoadAssetAtPath <SceneAsset>(TGPaths.FullScenePath(sceneDetails[j].sceneName)); // 找不到该场景则清除该场景 if (asset == null) { sceneDatas[i].sceneDetails.RemoveAt(j); } } } EditorUtility.SetDirty(m_settingData); }