Skip to content

Commit

Permalink
Move FileID Type Inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Apr 4, 2024
1 parent 534dd91 commit 29ab6c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Prowl.Editor/Assets/EditorAssetProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ public class EditorAssetProvider : IAssetProvider
{
public bool HasAsset(Guid assetID) => AssetDatabase.Contains(assetID);

public AssetRef<T> LoadAsset<T>(string relativeAssetPath, int fileID = 0) where T : EngineObject
public AssetRef<T> LoadAsset<T>(string relativeAssetPath, short fileID = 0) where T : EngineObject
{
// The Editor is a special case, its just a wrapper around the AssetDatabase
var fileInfo = AssetDatabase.FromRelativePath(relativeAssetPath);
return new AssetRef<T>(AssetDatabase.LoadAsset<T>(fileInfo, fileID));
}

public AssetRef<T> LoadAsset<T>(Guid guid, int fileID = 0) where T : EngineObject
public AssetRef<T> LoadAsset<T>(Guid guid, short fileID = 0) where T : EngineObject
{
// The Editor is a special case, its just a wrapper around the AssetDatabase
return new AssetRef<T>(AssetDatabase.LoadAsset<T>(guid, fileID));
Expand Down
4 changes: 2 additions & 2 deletions Prowl.Runtime/IAssetProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace Prowl.Runtime
public interface IAssetProvider
{
public bool HasAsset(Guid assetID);
public AssetRef<T> LoadAsset<T>(string relativeAssetPath, int fileID = 0) where T : EngineObject;
public AssetRef<T> LoadAsset<T>(Guid guid, int fileID = 0) where T : EngineObject;
public AssetRef<T> LoadAsset<T>(string relativeAssetPath, short fileID = 0) where T : EngineObject;
public AssetRef<T> LoadAsset<T>(Guid guid, short fileID = 0) where T : EngineObject;
public AssetRef<T> LoadAsset<T>(IAssetRef assetID) where T : EngineObject;
public SerializedAsset? LoadAsset(Guid guid);
}
Expand Down
4 changes: 2 additions & 2 deletions Prowl.Standalone/StandaloneAssetProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public StandaloneAssetProvider()

public bool HasAsset(Guid assetID) => _loaded.ContainsKey(assetID);

public AssetRef<T> LoadAsset<T>(string relativeAssetPath, int fileID = 0) where T : EngineObject
public AssetRef<T> LoadAsset<T>(string relativeAssetPath, short fileID = 0) where T : EngineObject
{
Guid guid = GetGuidFromPath(relativeAssetPath);
if (_loaded.ContainsKey(guid))
Expand All @@ -38,7 +38,7 @@ public AssetRef<T> LoadAsset<T>(string relativeAssetPath, int fileID = 0) where
throw new FileNotFoundException($"Asset with path {relativeAssetPath} not found.");
}

public AssetRef<T> LoadAsset<T>(Guid guid, int fileID = 0) where T : EngineObject
public AssetRef<T> LoadAsset<T>(Guid guid, short fileID = 0) where T : EngineObject
{
if (_loaded.ContainsKey(guid))
return (T)(fileID == 0 ? _loaded[guid].Main : _loaded[guid].SubAssets[fileID]);
Expand Down

0 comments on commit 29ab6c7

Please sign in to comment.