Skip to content

Commit 613055e

Browse files
committed
fix: model on wasm
1 parent 6ccc052 commit 613055e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Assets/Dojo/Runtime/Torii/Model.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Model(string name, Dictionary<string, WasmValue> members)
5050

5151
Members = members.ToDictionary(k => k.Key, v => HandleWasmValue(v.Value));
5252
}
53-
#else
53+
#endif
5454

5555
public Model(string name, Dictionary<string, object> members)
5656
{
@@ -100,6 +100,7 @@ private object HandleCValue(dojo.Ty ty)
100100
};
101101
}
102102

103+
#if UNITY_WEBGL && !UNITY_EDITOR
103104
private object HandleWasmValue(WasmValue value)
104105
{
105106
return value.type.ToLower() switch
@@ -147,7 +148,7 @@ private object HandleWasmValue(WasmValue value)
147148
_ => throw new Exception("Unknown type: " + value.type)
148149
};
149150
}
150-
151+
#endif
151152
private byte[] hexStringToByteArray(string hex)
152153
{
153154
// Remove "0x" prefix if present
@@ -181,6 +182,7 @@ private Enum HandleCEnum(dojo.Enum en)
181182
return new Enum(en.name, option.name, HandleCValue(option.ty));
182183
}
183184

185+
#if UNITY_WEBGL && !UNITY_EDITOR
184186
private Struct HandleJSStruct(string name, Dictionary<string, WasmValue> str)
185187
{
186188
return new Struct(name, str.Select(m => new KeyValuePair<string, object>(m.Key, HandleWasmValue(m.Value))).ToDictionary(k => k.Key, v => v.Value));
@@ -190,7 +192,7 @@ private Enum HandleJSEnum(string name, WasmEnum en)
190192
{
191193
return new Enum(name, en.option, HandleWasmValue(en.value));
192194
}
193-
195+
#endif
194196
private BigInteger ConvertTwosComplementToBigInteger(byte[] bytes, bool unsigned = false, int bits = 128)
195197
{
196198
var reversed = bytes.Reverse().ToArray();

0 commit comments

Comments
 (0)