1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //------------------------------------------------------------
- // Game Framework
- // Copyright © 2013-2021 loyalsoft. All rights reserved.
- // Homepage: http://www.game7000.com/
- // Feedback: http://www.game7000.com/
- //------------------------------------------------------------
- using System;
- using UnityEditor;
- namespace UnityGameFramework.Editor.ResourceTools
- {
- /// <summary>
- /// 资源。
- /// </summary>
- public sealed class Asset : IComparable<Asset>
- {
- private Asset(string guid, Resource resource)
- {
- Guid = guid;
- Resource = resource;
- }
- public string Guid
- {
- get;
- private set;
- }
- public string Name
- {
- get
- {
- return AssetDatabase.GUIDToAssetPath(Guid);
- }
- }
- public Resource Resource
- {
- get;
- set;
- }
- public int CompareTo(Asset asset)
- {
- return string.Compare(Guid, asset.Guid, StringComparison.Ordinal);
- }
- public static Asset Create(string guid)
- {
- return new Asset(guid, null);
- }
- public static Asset Create(string guid, Resource resource)
- {
- return new Asset(guid, resource);
- }
- }
- }
|