1.全阶段异步加载与AB包预加载2.node加载无效的问题依然存在
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Demo.Game
|
||||
public interface IDependOnSplineCore : IScriptableObject
|
||||
{
|
||||
SplineCore MySplineCore { get; set; }
|
||||
void LoadSpline(string path);
|
||||
IEnumerator LoadSpline(string path);
|
||||
}
|
||||
|
||||
public static class DependOnSplineCoreUtility
|
||||
@@ -38,14 +38,14 @@ namespace Demo.Game
|
||||
/// 加载并绑定到新样条线
|
||||
/// </summary>
|
||||
/// <param name="path">对象相对路径,若对象不存在则作为脚本相对路径加载</param>
|
||||
public static void LoadSplineTool(this IDependOnSplineCore self, string path)
|
||||
public static IEnumerator LoadSplineTool(this IDependOnSplineCore self, string path)
|
||||
{
|
||||
var spline = self.SharedInterfaceScriptObject.FindWithPath(path, false);
|
||||
if (spline == null)
|
||||
spline = self.SharedInterfaceScriptObject.LoadSubScript(nameof(SplineCore), path);
|
||||
if (spline != null)
|
||||
yield return self.SharedInterfaceScriptObject.LoadSubScriptAsync(nameof(SplineCore), path, x => spline = x);
|
||||
if (spline is SplineCore sc)
|
||||
{
|
||||
self.MySplineCore = spline as SplineCore;
|
||||
self.MySplineCore = sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -158,13 +158,15 @@ namespace Demo.Game
|
||||
</summary>
|
||||
<param name=""path"">脚本位置</param>
|
||||
")]
|
||||
public void LoadNode(string path)
|
||||
public IEnumerator LoadNode(string path)
|
||||
{
|
||||
var node = LoadSubScript(nameof(SplineNode), path);
|
||||
if (node != null)
|
||||
yield return LoadSubScriptAsync(nameof(SplineNode), path, node =>
|
||||
{
|
||||
MySplineNodes.Add(node as SplineNode);
|
||||
}
|
||||
if (node != null)
|
||||
{
|
||||
MySplineNodes.Add(node as SplineNode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user