Skip to content

Commit

Permalink
Added AssetDatabase.GetTypeOfAsset(guid, fileID)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Apr 3, 2024
1 parent 5ca6dc3 commit 9de408f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Prowl.Editor/Assets/AssetDatabase.Utilities.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using Prowl.Runtime;
using System.Diagnostics;
using System.Reflection;

namespace Prowl.Editor.Assets
Expand Down Expand Up @@ -179,6 +180,14 @@ public static void GenerateUniqueAssetPath(ref FileInfo file)
return result;
}

public static Type GetTypeOfAsset(Guid guid, ushort fileID)
{
if(assetGuidToMeta.TryGetValue(guid, out var meta))
if(meta.assetTypes.Length > fileID)
return RuntimeUtils.FindType(meta.assetTypes[fileID]);
return null;
}

#endregion

#region Private Methods
Expand Down

0 comments on commit 9de408f

Please sign in to comment.