SHA256
Add WithEndCondition to RenderSession
This commit is contained in:
2 files changed
+9
-2
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user