Update AssetReference.cs

This commit is contained in:
ALEXTANG
2023-07-19 17:33:52 +08:00
parent c1a1de73cd
commit 29135228be

View File

@@ -220,7 +220,7 @@ namespace TEngine
throw new GameFrameworkException($"BindAssetReference Failed => AssetOperationHandle is null!");
}
var ret = go.AddComponent<AssetReference>();
var ret = go.GetOrAddComponent<AssetReference>();
ret.Bind(operation: handle, assetLocation: location, parent: parent);
@@ -242,7 +242,7 @@ namespace TEngine
throw new GameFrameworkException($"BindAssetReference Failed => GameObject is null!");
}
var ret = go.AddComponent<AssetReference>();
var ret = go.GetOrAddComponent<AssetReference>();
ret.Bind(operation: null, assetLocation: location, parent: parent);