5using System.Diagnostics.CodeAnalysis;
8using Object = UnityEngine.Object;
12 public sealed partial class Asset
14 private static String s_LastErrorMessage = String.Empty;
26 [ExcludeFromCodeCoverage]
27 public static Texture2D
GetIcon([NotNull]
Path path) => AssetDatabase.GetCachedIcon(path) as Texture2D;
37 [ExcludeFromCodeCoverage]
56 private static void SetLastErrorMessage(String message) =>
57 s_LastErrorMessage = message !=
null ? message : String.Empty;
59 private static Boolean Succeeded(String possibleErrorMessage)
61 SetLastErrorMessage(possibleErrorMessage);
static Path Get([NotNull] Object asset)
Gets the relative path of an asset.
Represents a relative path to an asset file or folder, typically under 'Assets' or 'Packages'.
static Texture2D GetIcon([NotNull] Path path)
Returns the icon associated with the asset type.
static Texture2D GetIcon([NotNull] Object asset)
Returns the icon associated with the asset type.
static String GetLastErrorMessage()
Returns the last error message returned by some methods that provide such a failure message.