BuildReportTool.ReportManager.RefreshListOfAllPrefabsUsedInAllScenes C# (CSharp) Method

RefreshListOfAllPrefabsUsedInAllScenes() static private method

static private RefreshListOfAllPrefabsUsedInAllScenes ( ) : void
return void
	static void RefreshListOfAllPrefabsUsedInAllScenes()
	{
		ClearListOfAllPrefabsUsedInAllScenes();

#if USE_PREFAB_USAGE_DETECTION_METHOD_B
		foreach (EditorBuildSettingsScene S in EditorBuildSettings.scenes)
		{
			//Debug.Log(S.path);
			if (S.enabled)
			{
				AddAllPrefabsUsedInScene(S.path);
			}
		}
#else
		foreach (EditorBuildSettingsScene S in EditorBuildSettings.scenes)
		{
			if (S.enabled)
			{
				string name = S.path.Substring(S.path.LastIndexOf('/')+1);
				name = name.Substring(0,name.Length-6);
				//Debug.Log("scene: " + name);
				//temp.Add(name);
				UnityEngine.Object sceneAsset = AssetDatabase.LoadMainAssetAtPath(S.path);
				UnityEngine.Object[] deps = EditorUtility.CollectDependencies(new UnityEngine.Object[]{sceneAsset});
				foreach (UnityEngine.Object o in deps)
				{
					if (o != null && PrefabUtility.GetPrefabType(o) == PrefabType.Prefab)
					{
						string prefabPath = AssetDatabase.GetAssetPath(o);
						//Debug.Log("   prefab: " + o.name + " path: " + AssetDatabase.GetAssetPath(o));
						if (!_prefabsUsedInScenes.ContainsKey(prefabPath))
						{
							//Debug.Log("   prefab used: " + o.name + " path: " + prefabPath);
							_prefabsUsedInScenes.Add(prefabPath, false);
						}
					}
				}
			}
		}
#endif
	}