AddressableManifest.Editor.cs 621 B

1234567891011121314151617181920212223
  1. #if UNITY_EDITOR
  2. namespace XGame.Framework.Asset.Addressable
  3. {
  4. interface IAddressableEditorHandler
  5. {
  6. string GetAssetGUID(string addressableName);
  7. }
  8. internal partial class CSharpAddressableManifest : IAddressableEditorHandler
  9. {
  10. public string GetAssetGUID(string addressableName)
  11. {
  12. if (_nameToIdMap.TryGetValue(addressableName, out var addressableId) &&
  13. _assetInfoMap.TryGetValue(addressableId, out var assetInfo))
  14. {
  15. return assetInfo.assetGUID;
  16. }
  17. return string.Empty;
  18. }
  19. }
  20. }
  21. #endif