CodeSmile AssetDatabase 1.10
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ GetMainType() [2/2]

static Type GetMainType ( GUID guid)
static

Returns the type of the main asset for the GUID.

In Unity 2023.2 or newer it uses AssetDatabase.GetMainAssetTypeFromGUID. In earlier versions the type is obtained from the path's GUID.

Parameters
guidGuid of an asset.
Returns
Type of the asset. Null if the guid is not known or not an asset.
See also

Definition at line 971 of file Asset.File.cs.

972 {
973#if UNITY_2023_2_OR_NEWER // below 2023.2 the type is obtained from the path the GUID resolves to
974 return AssetDatabase.GetMainAssetTypeFromGUID(guid);
975#else
976 return GetMainType(Path.Get(guid));
977#endif
978 }

References Asset.Path.Get(), and GetMainType().

+ Here is the call graph for this function: