Skip to content

Commit 510b609

Browse files
authored
feat: use new unity ecsact plugin (#12)
1 parent c6906bb commit 510b609

File tree

9 files changed

+284
-253
lines changed

9 files changed

+284
-253
lines changed

unity-csharp-basic/.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
# Autogenerated Jetbrains Rider plugin
2424
/[Aa]ssets/Plugins/Editor/JetBrains*
2525

26+
# Some ecsact build artifacts
27+
/[Aa]ssets/Plugins/EcsactRuntime.exp
28+
/[Aa]ssets/Plugins/EcsactRuntime.exp.meta
29+
/[Aa]ssets/Plugins/EcsactRuntime.ilk
30+
/[Aa]ssets/Plugins/EcsactRuntime.ilk.meta
31+
/[Aa]ssets/Plugins/EcsactRuntime.lib
32+
/[Aa]ssets/Plugins/EcsactRuntime.lib.meta
33+
2634
# Visual Studio cache directory
2735
.vs/
2836

@@ -71,4 +79,4 @@ crashlytics-build.properties
7179
/[Aa]ssets/[Ss]treamingAssets/aa.meta
7280
/[Aa]ssets/[Ss]treamingAssets/aa/*
7381

74-
.vscode
82+
.vscode

unity-csharp-basic/Assets/Editor/EcsactSettings.asset

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ MonoBehaviour:
1818
runtimeBuilderDebugBuild: 1
1919
runtimeBuilderPrintSubcommandStdout: 1
2020
runtimeBuilderPrintSubcommandStderr: 1
21-
recipePath: rt_entt
21+
recipes:
22+
- async_reference
23+
- rt_entt
24+
- serialize_reference
25+
- si_wasmer
2226
runtimeBuilderCompilerPath:
59.1 MB
Binary file not shown.

unity-csharp-basic/Assets/Scripts/AsyncExample/AsyncMenu.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using UnityEngine.UI;
44
using UnityEngine.SceneManagement;
55
using TMPro;
6+
using System.Text;
67

78
public class AsyncMenu : MonoBehaviour {
89

@@ -34,13 +35,18 @@ void OnEnable() {
3435
}
3536

3637
void onButtonClick() {
38+
var asyncRunner = Ecsact.Defaults.Runner as Ecsact.AsyncRunner;
39+
if(asyncRunner == null) {
40+
Debug.LogError("Async menu example can only be used with the Async Runner - change your runner in the Ecsact Unity project settings");
41+
return;
42+
}
3743
var sceneName = options[dropdown.value];
3844
Debug.Log("Loading scene " + sceneName);
3945
SceneManager.LoadScene(sceneName);
4046

4147
Debug.Log("connecting with: " + connectionString.text);
4248

43-
Ecsact.Defaults.Runtime.async.Connect(connectionString.text);
49+
asyncRunner.sessionId = Ecsact.Defaults.Runtime.async.Start(Encoding.ASCII.GetBytes(connectionString.text));
4450

4551
this.gameObject.SetActive(false);
4652
}

0 commit comments

Comments
 (0)