Exemplo n.º 1
0
 public void SyncWithLib(RTPrefabLib prefabLib)
 {
     ClearPreviews();
     if (prefabLib != null)
     {
         for (int prefabIndex = 0; prefabIndex < prefabLib.NumPrefabs; ++prefabIndex)
         {
             RTPrefab prefab = prefabLib.GetPrefab(prefabIndex);
             AddPrefabPreview(prefab);
         }
     }
 }
Exemplo n.º 2
0
 public void RefreshEditorPrefabPreviews()
 {
     EditorPrefabPreviewGen.BeginGenSession(PrefabPreviewLookAndFeel);
     for (int libIndex = 0; libIndex < NumLibs; ++libIndex)
     {
         RTPrefabLib lib = _libs[libIndex];
         EditorUtility.DisplayProgressBar("Refreshing previews...", lib.Name, (float)(libIndex + 1) / NumLibs);
         for (int prefabIndex = 0; prefabIndex < lib.NumPrefabs; ++prefabIndex)
         {
             RTPrefab prefab = lib.GetPrefab(prefabIndex);
             if (prefab.PreviewTexture != null)
             {
                 Texture2D.DestroyImmediate(prefab.PreviewTexture);
             }
             prefab.PreviewTexture = EditorPrefabPreviewGen.Generate(prefab.UnityPrefab);
         }
     }
     EditorUtility.ClearProgressBar();
     EditorPrefabPreviewGen.EndGenSession();
 }