Add WithEndCondition to RenderSession

This commit is contained in:
copecone committed 2026-08-18 00:19:04 +09:00
1 parent 437a8b598e
commit 05d43f3bc2
2 files changed
+9 -2

No files matched your search

+9
View File
@@ -29,6 +29,8 @@ public class RenderSession
private bool _timePatch = true;
private bool _screenPatch = true;
private static Func<bool> _endCondition = () => scrController.instance.state == States.Won;
/// <summary>
/// Sets whether automatic rendering is enabled.
@@ -60,6 +62,12 @@ public class RenderSession
return this;
}
public RenderSession WithEndCondition(Func<bool> endCondition)
{
_endCondition = endCondition;
return this;
}
/// <summary>
/// Applies the configured flags and initiates the render session.
/// </summary>
@@ -70,6 +78,7 @@ public class RenderSession
RenderContext.Auto = _auto;
RenderContext.TimePatch = _timePatch;
RenderContext.ScreenPatch = _screenPatch;
RenderContext.EndCondition = _endCondition;
RenderManager.Instance.levelPath = levelPath;
RenderManager.Instance.Configuration = renderConfig;