Skip to content

Commit

Permalink
feat: compiling for ios ok but crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jan 26, 2024
1 parent c5543c1 commit 57a9896
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 19 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Assets/.DS_Store
Binary file not shown.
Binary file modified Assets/Dojo/.DS_Store
Binary file not shown.
Binary file modified Assets/Dojo/Plugins/Linux/libdojo_c.so
Binary file not shown.
59 changes: 57 additions & 2 deletions Assets/Dojo/Plugins/Linux/libdojo_c.so.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Dojo/Plugins/Windows/libdojo_c.dll
Git LFS file not shown
59 changes: 57 additions & 2 deletions Assets/Dojo/Plugins/Windows/libdojo_c.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Dojo/Plugins/iOS/libdojo_c.a
Git LFS file not shown
64 changes: 62 additions & 2 deletions Assets/Dojo/Plugins/iOS/libdojo_c.a.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/Dojo/Plugins/iOS/libdojo_c.dylib
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Dojo/Plugins/iOS/libdojo_c.dylib.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/Dojo/Plugins/macOS/libdojo_c.bundle
Binary file not shown.
4 changes: 3 additions & 1 deletion Assets/Dojo/Runtime/Starknet/StarknetInterop.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_WEBGL && !UNITY_EDITOR
using System;
using System.Diagnostics;
using System.Linq;
Expand Down Expand Up @@ -116,4 +117,5 @@ public static Task<bool> WaitForTransactionAsync(IntPtr provider, FieldElement t
[DllImport("__Internal")]
public static extern bool Verify(CString publicKey, CString hash, CString r, CString s);
}
}
}
#endif
4 changes: 0 additions & 4 deletions Assets/Dojo/Runtime/Torii/ToriiClient.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using bottlenoselabs.C2CS.Runtime;
using UnityEngine;
using dojo_bindings;
using JetBrains.Annotations;
using Dojo.Starknet;
using UnityEditor.AppleTV;
namespace Dojo.Torii
{
public unsafe class ToriiClient
Expand Down
4 changes: 3 additions & 1 deletion Assets/Dojo/Runtime/Torii/ToriiWasmClient.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_WEBGL && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -35,4 +36,5 @@ public async Task<List<Entity>> Entities(int limit, int offset)
return entities;
}
}
}
}
#endif
5 changes: 4 additions & 1 deletion Assets/Dojo/Runtime/Torii/ToriiWasmInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
namespace Dojo.Torii
{
[System.Serializable]
public struct WasmValue {
public struct WasmValue
{
public string type;
public JToken value;
}

#if UNITY_WEBGL && !UNITY_EDITOR
public class ToriiWasmInterop : MonoBehaviour
{
// Creates a new client and returns the pointer to it
Expand Down Expand Up @@ -136,4 +138,5 @@ public static void OnEntityUpdated(IntPtr clientPtr, FieldElement[] ids)
[DllImport("__Internal")]
public static extern void OnSyncModelChange(IntPtr clientPtr, string model, string callbackObjectName, string callbackMethodName);
}
#endif
}
2 changes: 2 additions & 0 deletions Assets/Dojo/Runtime/WorldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public class WorldManager : MonoBehaviour
public string worldAddress;
public SynchronizationMaster synchronizationMaster;
public ToriiClient toriiClient;
#if UNITY_WEBGL && !UNITY_EDITOR
public ToriiWasmClient wasmClient;
#endif

async void Awake()
{
Expand Down
4 changes: 4 additions & 0 deletions Assets/Dojo/Runtime/bindings/client/dojo.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ namespace dojo_bindings

public static unsafe partial class dojo
{
#if UNITY_IPHONE && !UNITY_EDITOR
private const string LibraryName = "__Internal";
#else
private const string LibraryName = "dojo_c";
#endif

#region API

Expand Down
3 changes: 2 additions & 1 deletion Scripts/libgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ lipo -create -output "../../Assets/Dojo/Plugins/macOS/libdojo_c.bundle" \

# iOS
mkdir -p "../../Assets/Dojo/Plugins/iOS"
cp -f "target/aarch64-apple-ios/$build/libdojo_c.a" "../../Assets/Dojo/Plugins/iOS/libdojo_c.a"
cp -f "target/aarch64-apple-ios/$build/libdojo_c.dylib" "../../Assets/Dojo/Plugins/iOS/libdojo_c.dylib"
cp -f "target/aarch64-apple-ios/$build/libdojo_c.dylib" "../../Assets/Dojo/Plugins/iOS/libdojo_c.a"

0 comments on commit 57a9896

Please sign in to comment.