-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcell.asl
50 lines (41 loc) · 968 Bytes
/
cell.asl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
state("Cell Machine") { }
startup
{
Assembly.Load(File.ReadAllBytes("Components/asl-help")).CreateInstance("Unity");
vars.Helper.GameName = "Cell Machine";
vars.Helper.LoadSceneManager = true;
vars.CompletedLevels = new HashSet<int>();
}
init
{
vars.Helper.TryLoad = (Func<dynamic, bool>)(mono =>
{
var GD = mono["GameData"];
vars.Helper["level"] = GD.Make<int>(
"level"
);
var GM = mono["GridManager"];
vars.Helper["levelWon"] = GM.Make<bool>(
"instance",
"levelWon"
);
return true;
});
current.activeScene = "";
}
update
{
current.activeScene = vars.Helper.Scenes.Active.Name ?? current.activeScene;
}
start
{
return old.activeScene == "Title" && current.activeScene == "Game";
}
onStart
{
vars.CompletedLevels.Clear();
}
split
{
return !old.levelWon && current.levelWon && vars.CompletedLevels.Add(current.level);
}