/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
using UnityEditor;
using Object = UnityEngine.Object;
namespace Live2D.Cubism.Editor.Importers
{
///
/// Provides helper methods for working with Unity assets.
///
internal static class AssetGuid
{
///
/// Loads an asset by Guid.
///
/// The type of asset to load.
/// The guid to query for.
/// The loaded asset on
public static T LoadAsset(string guid) where T : Object
{
return AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid));
}
///
/// Gets the Guid of an asset.
///
///
///
public static string GetGuid(T asset) where T : Object
{
return AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset));
}
}
}