Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. string[] guids = AssetDatabase.FindAssets(string.Format("t:{0}", typeof(CarInformation)));
  2. if (guids.Length>0)
  3. {
  4. allCars.Clear();
  5. for (int i = 0; i < guids.Length; i++)
  6. {
  7. string assetPath = AssetDatabase.GUIDToAssetPath(guids[i]);
  8. CarInformation asset = AssetDatabase.LoadAssetAtPath<CarInformation>(assetPath);
  9. if (asset != null)
  10. {
  11. allCars.Add(asset);
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement