TEngine 6

This commit is contained in:
Alex-Rachel
2025-03-07 23:09:46 +08:00
parent aad8ff3ee5
commit 551727687f
1988 changed files with 46223 additions and 94880 deletions

View File

@@ -9,7 +9,7 @@ namespace YooAsset.Editor
private readonly Dictionary<System.Type, IContextObject> _contextObjects = new Dictionary<System.Type, IContextObject>();
/// <summary>
/// 清空所有情景对象
/// 清空所有上下文对象
/// </summary>
public void ClearAllContext()
{
@@ -17,7 +17,7 @@ namespace YooAsset.Editor
}
/// <summary>
/// 设置情景对象
/// 设置上下文对象
/// </summary>
public void SetContextObject(IContextObject contextObject)
{
@@ -32,7 +32,7 @@ namespace YooAsset.Editor
}
/// <summary>
/// 获取情景对象
/// 获取上下文对象
/// </summary>
public T GetContextObject<T>() where T : IContextObject
{
@@ -46,5 +46,21 @@ namespace YooAsset.Editor
throw new Exception($"Not found context object : {type}");
}
}
/// <summary>
/// 获取上下文对象
/// </summary>
public T TryGetContextObject<T>() where T : IContextObject
{
var type = typeof(T);
if (_contextObjects.TryGetValue(type, out IContextObject contextObject))
{
return (T)contextObject;
}
else
{
return default;
}
}
}
}

View File

@@ -12,9 +12,9 @@ namespace YooAsset.Editor
BuildOutputRootIsNullOrEmpty = 113,
BuildinFileRootIsNullOrEmpty = 114,
PackageOutputDirectoryExists = 115,
BuildPipelineIsNullOrEmpty = 116,
BuildBundleTypeIsUnknown = 117,
RecommendScriptBuildPipeline = 130,
BuildPipelineNotSupportBuildMode = 140,
BuildPipelineNotSupportSharePackRule = 141,
// TaskGetBuildMap
RemoveInvalidTags = 200,
@@ -39,5 +39,6 @@ namespace YooAsset.Editor
// TaskCreateManifest
NotFoundUnityBundleInBuildResult = 600,
FoundStrayBundle = 601,
BundleHashConflict = 602,
}
}