Skip to content

Commit a55afed

Browse files
authored
Merge pull request #180 from leezak5555/patch-2
Unity Code stripping fix
2 parents 35c3a13 + 78229d2 commit a55afed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/codegen/languages/csharp.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,15 @@ function generateClass(klass: Class, namespace: string) {
6060
6161
using Colyseus.Schema;
6262
using Action = System.Action;
63+
#if UNITY_5_3_OR_NEWER
64+
using UnityEngine.Scripting;
65+
#endif
6366
${namespace ? `\nnamespace ${namespace} {` : ""}
6467
${indent}public partial class ${klass.name} : ${klass.extends} {
68+
#if UNITY_5_3_OR_NEWER
69+
[Preserve]
70+
#endif
71+
public ${klass.name}() { }
6572
${klass.properties.map((prop) => generateProperty(prop, indent)).join("\n\n")}
6673
6774
${indent}\t/*

0 commit comments

Comments
 (0)