Skip to content

Commit

Permalink
Merge pull request #180 from leezak5555/patch-2
Browse files Browse the repository at this point in the history
Unity Code stripping fix
  • Loading branch information
endel authored Aug 20, 2024
2 parents 35c3a13 + 78229d2 commit a55afed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/codegen/languages/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ function generateClass(klass: Class, namespace: string) {
using Colyseus.Schema;
using Action = System.Action;
#if UNITY_5_3_OR_NEWER
using UnityEngine.Scripting;
#endif
${namespace ? `\nnamespace ${namespace} {` : ""}
${indent}public partial class ${klass.name} : ${klass.extends} {
#if UNITY_5_3_OR_NEWER
[Preserve]
#endif
public ${klass.name}() { }
${klass.properties.map((prop) => generateProperty(prop, indent)).join("\n\n")}
${indent}\t/*
Expand Down

0 comments on commit a55afed

Please sign in to comment.