Skip to content

Commit 45c9ef0

Browse files
committed
Callback
1 parent 1795ee5 commit 45c9ef0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Examples/Scripts/Juce.CoreUnity.Examples.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "Juce.CoreUnity.Examples",
33
"rootNamespace": "",
44
"references": [
5-
"GUID:66f84fddbd56756439bdf88a8207ce7e"
5+
"GUID:66f84fddbd56756439bdf88a8207ce7e",
6+
"GUID:9a64ff96d3b16d7498c8f46b660d81a0"
67
],
78
"includePlatforms": [],
89
"excludePlatforms": [],

Runtime/Ui/ViewStack/Sequences/IViewStackSequenceBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading;
1+
using System;
2+
using System.Threading;
23
using System.Threading.Tasks;
34

45
namespace Juce.CoreUnity.ViewStack.Sequences
@@ -13,6 +14,7 @@ public interface IViewStackSequenceBuilder
1314
IViewStackSequenceBuilder MoveToBackground<T>();
1415
IViewStackSequenceBuilder SetInteractable<T>(bool set);
1516
IViewStackSequenceBuilder CurrentSetInteractable(bool set);
17+
IViewStackSequenceBuilder Callback(Action callback);
1618

1719
Task Execute(CancellationToken cancellationToken);
1820
void Execute();

Runtime/Ui/ViewStack/Sequences/ViewStackSequenceBuilder.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ public IViewStackSequenceBuilder CurrentSetInteractable(bool set)
152152
return this;
153153
}
154154

155+
public IViewStackSequenceBuilder Callback(Action callback)
156+
{
157+
instructionsToPlay.Add(new ActionInstruction(callback));
158+
159+
return this;
160+
}
161+
155162
public Task Execute(CancellationToken cancellationToken)
156163
{
157164
foreach(Instruction instruction in instructionsToPlay)

0 commit comments

Comments
 (0)