@needle-tools/needle-component-compiler 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/Changelog.md +8 -0
  2. package/package.json +1 -1
  3. package/src/component-compiler.js +27 -9
  4. package/src/component-compiler.ts +28 -10
  5. package/src/test.js +1 -1
  6. package/src/test.ts +1 -1
  7. package/src/types.js +1 -1
  8. package/test/component.basic.test.ts +6 -2
  9. package/test/component.primitives.test.js +14 -0
  10. package/test/component.primitives.test.ts +35 -0
  11. package/schemes/MyNew.component.json +0 -1
  12. package/schemes/MyTest.component.json +0 -1
  13. package/test/blender/codegen/basic/expected.component.json +0 -4
  14. package/test/blender/codegen/basic/input.js +0 -26
  15. package/test/blender/codegen/basic/input.ts +0 -3
  16. package/test/blender/codegen/basic/output.component.json +0 -1
  17. package/test/blender/codegen/float field/expected.component.json +0 -8
  18. package/test/blender/codegen/float field/input.js +0 -28
  19. package/test/blender/codegen/float field/input.ts +0 -4
  20. package/test/blender/codegen/float field/output.component.json +0 -1
  21. package/test/blender/codegen/reference_animation/expected.component.json +0 -7
  22. package/test/blender/codegen/reference_animation/input.js +0 -35
  23. package/test/blender/codegen/reference_animation/input.ts +0 -4
  24. package/test/blender/codegen/reference_animation/output.component.json +0 -1
  25. package/test/blender/codegen/reference_behaviour/expected.component.json +0 -7
  26. package/test/blender/codegen/reference_behaviour/input.js +0 -35
  27. package/test/blender/codegen/reference_behaviour/input.ts +0 -5
  28. package/test/blender/codegen/reference_behaviour/output.component.json +0 -1
  29. package/test/csharp/codegen/abstract method/expected.cs +0 -14
  30. package/test/csharp/codegen/abstract method/input.js +0 -27
  31. package/test/csharp/codegen/abstract method/input.ts +0 -4
  32. package/test/csharp/codegen/abstract method/output.cs +0 -14
  33. package/test/csharp/codegen/basic/expected.cs +0 -13
  34. package/test/csharp/codegen/basic/input.js +0 -26
  35. package/test/csharp/codegen/basic/input.ts +0 -2
  36. package/test/csharp/codegen/basic/output.cs +0 -13
  37. package/test/csharp/codegen/basic-no-export/expected.cs +0 -0
  38. package/test/csharp/codegen/basic-no-export/input.js +0 -27
  39. package/test/csharp/codegen/basic-no-export/input.ts +0 -4
  40. package/test/csharp/codegen/basic-no-export/output.cs +0 -0
  41. package/test/csharp/codegen/bool/expected.cs +0 -14
  42. package/test/csharp/codegen/bool/input.js +0 -26
  43. package/test/csharp/codegen/bool/input.ts +0 -3
  44. package/test/csharp/codegen/bool/output.cs +0 -14
  45. package/test/csharp/codegen/fields with default values/expected.cs +0 -18
  46. package/test/csharp/codegen/fields with default values/input.js +0 -32
  47. package/test/csharp/codegen/fields with default values/input.ts +0 -7
  48. package/test/csharp/codegen/fields with default values/output.cs +0 -18
  49. package/test/csharp/codegen/method ignore inline type declaration/expected.cs +0 -14
  50. package/test/csharp/codegen/method ignore inline type declaration/input.js +0 -27
  51. package/test/csharp/codegen/method ignore inline type declaration/input.ts +0 -3
  52. package/test/csharp/codegen/method ignore inline type declaration/output.cs +0 -14
  53. package/test/csharp/codegen/nonserialized ignore field/expected.cs +0 -13
  54. package/test/csharp/codegen/nonserialized ignore field/input.js +0 -26
  55. package/test/csharp/codegen/nonserialized ignore field/input.ts +0 -4
  56. package/test/csharp/codegen/nonserialized ignore field/output.cs +0 -13
  57. package/test/csharp/codegen/nonserialized on property does not affect method/expected.cs +0 -14
  58. package/test/csharp/codegen/nonserialized on property does not affect method/input.js +0 -34
  59. package/test/csharp/codegen/nonserialized on property does not affect method/input.ts +0 -8
  60. package/test/csharp/codegen/nonserialized on property does not affect method/output.cs +0 -13
  61. package/test/csharp/codegen/number/expected.cs +0 -14
  62. package/test/csharp/codegen/number/input.js +0 -26
  63. package/test/csharp/codegen/number/input.ts +0 -3
  64. package/test/csharp/codegen/number/output.cs +0 -14
  65. package/test/csharp/codegen/object/expected.cs +0 -14
  66. package/test/csharp/codegen/object/input.js +0 -26
  67. package/test/csharp/codegen/object/input.ts +0 -3
  68. package/test/csharp/codegen/object/output.cs +0 -14
  69. package/test/csharp/codegen/private.methods/expected.cs +0 -13
  70. package/test/csharp/codegen/private.methods/input.js +0 -27
  71. package/test/csharp/codegen/private.methods/input.ts +0 -3
  72. package/test/csharp/codegen/private.methods/output.cs +0 -13
  73. package/test/csharp/codegen/protected.methods/expected.cs +0 -13
  74. package/test/csharp/codegen/protected.methods/input.js +0 -27
  75. package/test/csharp/codegen/protected.methods/input.ts +0 -3
  76. package/test/csharp/codegen/protected.methods/output.cs +0 -13
  77. package/test/csharp/codegen/public method with args/expected.cs +0 -14
  78. package/test/csharp/codegen/public method with args/input.js +0 -27
  79. package/test/csharp/codegen/public method with args/input.ts +0 -3
  80. package/test/csharp/codegen/public method with args/output.cs +0 -14
  81. package/test/csharp/codegen/public method with multiple args/expected.cs +0 -14
  82. package/test/csharp/codegen/public method with multiple args/input.js +0 -27
  83. package/test/csharp/codegen/public method with multiple args/input.ts +0 -3
  84. package/test/csharp/codegen/public method with multiple args/output.cs +0 -14
  85. package/test/csharp/codegen/public.methods/expected.cs +0 -14
  86. package/test/csharp/codegen/public.methods/input.js +0 -27
  87. package/test/csharp/codegen/public.methods/input.ts +0 -3
  88. package/test/csharp/codegen/public.methods/output.cs +0 -14
  89. package/test/csharp/codegen/static method/expected.cs +0 -13
  90. package/test/csharp/codegen/static method/input.js +0 -27
  91. package/test/csharp/codegen/static method/input.ts +0 -3
  92. package/test/csharp/codegen/static method/output.cs +0 -14
  93. package/test/csharp/codegen/string/expected.cs +0 -14
  94. package/test/csharp/codegen/string/input.js +0 -26
  95. package/test/csharp/codegen/string/input.ts +0 -3
  96. package/test/csharp/codegen/string/output.cs +0 -14
  97. package/test/csharp/codegen/stringArray/expected.cs +0 -14
  98. package/test/csharp/codegen/stringArray/input.js +0 -26
  99. package/test/csharp/codegen/stringArray/input.ts +0 -3
  100. package/test/csharp/codegen/stringArray/output.cs +0 -14
package/Changelog.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.9.4] - 2023-05-24
8
+ - Change: `Object3D` now emits `GameObject` field instead of `Transform`
9
+ - Fix: ignore `static` methods
10
+ - Fix: ignore `abstract` methods
11
+
12
+ ## [1.9.3] - 2022-12-30
13
+ - Add debug logs for when no file or target directory was passed in. Also wrapping core with try catch
14
+
7
15
  ## [1.9.2] - 2022-11-29
8
16
  - Fix codegen deleting code added manually outside of codegen sections
9
17
  - Fix codegen creating output directory if it does not exist yet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/needle-component-compiler",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "description": "Compile mock unity components from typescript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -90,8 +90,9 @@ var ExportContext = /** @class */ (function () {
90
90
  this.append(text + "\n");
91
91
  };
92
92
  ExportContext.prototype.flush = function () {
93
- if (this.textBuffer.length <= 0)
93
+ if (this.textBuffer.length <= 0) {
94
94
  return;
95
+ }
95
96
  this.textBuffer = CODEGEN_MARKER_START + "\n" + this.textBuffer + "\n" + CODEGEN_MARKER_END;
96
97
  var code = this.textBuffer;
97
98
  if (this.outputDir !== null) {
@@ -104,6 +105,9 @@ var ExportContext = /** @class */ (function () {
104
105
  console.log("Write to " + path_1);
105
106
  fs.writeFileSync(path_1, code);
106
107
  }
108
+ else {
109
+ console.log("No output dir specified");
110
+ }
107
111
  this.reset();
108
112
  return code;
109
113
  };
@@ -238,7 +242,7 @@ function run(program, outputDir, sourceFile) {
238
242
  var meth = node;
239
243
  // const isCoroutine = func.asteriskToken;
240
244
  if (!skip && meth.name) {
241
- var pub_1 = isPublic(meth);
245
+ var pub_1 = shouldEmitMethod(meth);
242
246
  if (!pub_1)
243
247
  return;
244
248
  var paramsStr = "";
@@ -276,7 +280,7 @@ function run(program, outputDir, sourceFile) {
276
280
  console.log("Found variable", node.getText());
277
281
  var vardec = node;
278
282
  var varName = "@" + vardec.name.getText();
279
- var pub = isPublic(vardec);
283
+ var pub = shouldEmitMethod(vardec);
280
284
  var visibility = pub ? "public" : "private";
281
285
  var isAccessible = pub;
282
286
  dontSerialize = false;
@@ -497,16 +501,24 @@ function run(program, outputDir, sourceFile) {
497
501
  console.log("Unknown assignment:", str, ts.SyntaxKind[node.kind]);
498
502
  return str;
499
503
  }
500
- function isPublic(node) {
504
+ function shouldEmitMethod(node) {
501
505
  if (node.kind === ts.SyntaxKind.PublicKeyword) {
502
506
  return true;
503
507
  }
504
508
  else if (node.kind === ts.SyntaxKind.PrivateKeyword || node.kind === ts.SyntaxKind.ProtectedKeyword) {
505
509
  return false;
506
510
  }
511
+ // check if its static
512
+ else if (node.kind === ts.SyntaxKind.StaticKeyword) {
513
+ return false;
514
+ }
515
+ // check if its abstract
516
+ else if (node.kind === ts.SyntaxKind.AbstractKeyword) {
517
+ return false;
518
+ }
507
519
  for (var _i = 0, _a = node.getChildren(); _i < _a.length; _i++) {
508
520
  var ch = _a[_i];
509
- if (!isPublic(ch))
521
+ if (!shouldEmitMethod(ch))
510
522
  return false;
511
523
  }
512
524
  return true;
@@ -691,11 +703,17 @@ if (process) {
691
703
  var outputDir_1 = process.argv[2];
692
704
  var fileNames = process.argv.slice(3);
693
705
  fileNames.forEach(function (fileName) {
694
- if (!fs.existsSync(fileName)) {
706
+ try {
707
+ if (!fs.existsSync(fileName)) {
708
+ console.error("File not found: " + fileName);
709
+ }
710
+ else {
711
+ var code = (0, fs_1.readFileSync)(fileName).toString();
712
+ compile(code, fileName, outputDir_1);
713
+ }
695
714
  }
696
- else {
697
- var code = (0, fs_1.readFileSync)(fileName).toString();
698
- compile(code, fileName, outputDir_1);
715
+ catch (e) {
716
+ console.error(e);
699
717
  }
700
718
  });
701
719
  }
@@ -110,7 +110,9 @@ class ExportContext {
110
110
  }
111
111
 
112
112
  flush(): string {
113
- if (this.textBuffer.length <= 0) return;
113
+ if (this.textBuffer.length <= 0) {
114
+ return;
115
+ }
114
116
  this.textBuffer = CODEGEN_MARKER_START + "\n" + this.textBuffer + "\n" + CODEGEN_MARKER_END;
115
117
  let code = this.textBuffer;
116
118
  if (this.outputDir !== null) {
@@ -123,6 +125,9 @@ class ExportContext {
123
125
  console.log("Write to " + path);
124
126
  fs.writeFileSync(path, code);
125
127
  }
128
+ else {
129
+ console.log("No output dir specified");
130
+ }
126
131
  this.reset();
127
132
  return code;
128
133
  }
@@ -275,7 +280,7 @@ export function run(program: ts.Program, outputDir: string | null, sourceFile: t
275
280
  const meth = node as ts.MethodDeclaration;
276
281
  // const isCoroutine = func.asteriskToken;
277
282
  if (!skip && meth.name) {
278
- const pub = isPublic(meth);
283
+ const pub = shouldEmitMethod(meth);
279
284
  if (!pub) return;
280
285
 
281
286
  let paramsStr = "";
@@ -307,7 +312,7 @@ export function run(program: ts.Program, outputDir: string | null, sourceFile: t
307
312
  const vardec = node as ts.VariableDeclaration;
308
313
 
309
314
  const varName = "@" + vardec.name.getText();
310
- const pub = isPublic(vardec);
315
+ const pub = shouldEmitMethod(vardec);
311
316
  const visibility = pub ? "public" : "private";
312
317
  let isAccessible = pub;
313
318
  dontSerialize = false;
@@ -517,16 +522,24 @@ export function run(program: ts.Program, outputDir: string | null, sourceFile: t
517
522
  return str;
518
523
  }
519
524
 
520
- function isPublic(node: ts.Node): boolean {
525
+ function shouldEmitMethod(node: ts.Node): boolean {
521
526
  if (node.kind === ts.SyntaxKind.PublicKeyword) {
522
527
  return true;
523
528
  }
524
529
  else if (node.kind === ts.SyntaxKind.PrivateKeyword || node.kind === ts.SyntaxKind.ProtectedKeyword) {
525
530
  return false;
526
531
  }
532
+ // check if its static
533
+ else if (node.kind === ts.SyntaxKind.StaticKeyword) {
534
+ return false;
535
+ }
536
+ // check if its abstract
537
+ else if (node.kind === ts.SyntaxKind.AbstractKeyword) {
538
+ return false;
539
+ }
527
540
 
528
541
  for (const ch of node.getChildren()) {
529
- if (!isPublic(ch)) return false;
542
+ if (!shouldEmitMethod(ch)) return false;
530
543
  }
531
544
  return true;
532
545
  }
@@ -725,12 +738,17 @@ if (process) {
725
738
  const outputDir = process.argv[2];
726
739
  const fileNames = process.argv.slice(3);
727
740
  fileNames.forEach(fileName => {
728
- if (!fs.existsSync(fileName)) {
729
-
741
+ try {
742
+ if (!fs.existsSync(fileName)) {
743
+ console.error("File not found: " + fileName);
744
+ }
745
+ else {
746
+ const code = readFileSync(fileName).toString();
747
+ compile(code, fileName, outputDir);
748
+ }
730
749
  }
731
- else {
732
- const code = readFileSync(fileName).toString();
733
- compile(code, fileName, outputDir);
750
+ catch (e) {
751
+ console.error(e);
734
752
  }
735
753
  });
736
754
  }
package/src/test.js CHANGED
@@ -20,7 +20,7 @@ var MyTestComponent = /** @class */ (function (_super) {
20
20
  __extends(MyTestComponent, _super);
21
21
  function MyTestComponent() {
22
22
  var _this = _super !== null && _super.apply(this, arguments) || this;
23
- _this.myVecgfdsgtor2 = new Vector2(1, .5);
23
+ _this.myVector2 = new Vector2(1, .5);
24
24
  return _this;
25
25
  }
26
26
  MyTestComponent.prototype.myMethod = function () {
package/src/test.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ThisExpression } from "typescript";
2
2
 
3
3
  export class MyTestComponent extends Behaviour {
4
- public myVecgfdsgtor2: Vector2 = new Vector2(1, .5);
4
+ public myVector2: Vector2 = new Vector2(1, .5);
5
5
  private myMethod(){
6
6
 
7
7
  }
package/src/types.js CHANGED
@@ -12,7 +12,7 @@ const dict = {
12
12
  "Behaviour" : "UnityEngine.Behaviour",
13
13
  "Component" : "UnityEngine.Component",
14
14
  "GameObject" : "UnityEngine.GameObject",
15
- "Object3D" : "UnityEngine.Transform",
15
+ "Object3D" : "UnityEngine.GameObject",
16
16
  // Addressables
17
17
  "AssetReference" : "UnityEngine.Transform",
18
18
  // events
@@ -33,7 +33,7 @@ describe('Basic typescript', () => {
33
33
 
34
34
 
35
35
 
36
-
36
+
37
37
  it('should ignore abstract type', () => {
38
38
  compareCodegen("basic-no-export",
39
39
  // INPUT
@@ -46,8 +46,12 @@ describe('Basic typescript', () => {
46
46
  ``
47
47
  );
48
48
  });
49
+
49
50
 
50
51
 
51
- });
52
52
 
53
53
 
54
+
55
+
56
+ });
57
+
@@ -44,4 +44,18 @@ describe('Typescript with fields', function () {
44
44
  // EXPECTED
45
45
  "public partial class MyComponent : UnityEngine.MonoBehaviour\n\t{\n public float @myField = 42f;\n public string @myField2 = \"hello\";\n public bool @myField3 = true;\n public UnityEngine.Object @myField4;\n\t\tpublic UnityEngine.Vector2 @myVector2 = new UnityEngine.Vector2(1f, .5f);\n\t}");
46
46
  });
47
+ it('should generate component with GameObject reference', function () {
48
+ (0, helpers_1.compareCodegenWithDefaultContext)("object",
49
+ // INPUT
50
+ "export class MyComponent extends Behaviour {\n public myObject: Object3D;\n}\n",
51
+ // EXPECTED
52
+ "public partial class MyComponent : UnityEngine.MonoBehaviour\n\t{\n public UnityEngine.GameObject @myObject;\n\t}");
53
+ });
54
+ it('should generate component with RectTransform reference', function () {
55
+ (0, helpers_1.compareCodegenWithDefaultContext)("object",
56
+ // INPUT
57
+ "export class MyComponent extends Behaviour {\n public myRect: RectTransform;\n}\n",
58
+ // EXPECTED
59
+ "public partial class MyComponent : UnityEngine.MonoBehaviour\n\t{\n public UnityEngine.RectTransform @myRect;\n\t}");
60
+ });
47
61
  });
@@ -120,4 +120,39 @@ describe('Typescript with fields', () => {
120
120
 
121
121
 
122
122
 
123
+ it('should generate component with GameObject reference', () => {
124
+ compareCodegenWithDefaultContext("object",
125
+ // INPUT
126
+ `export class MyComponent extends Behaviour {
127
+ public myObject: Object3D;
128
+ }
129
+ `,
130
+ // EXPECTED
131
+ `public partial class MyComponent : UnityEngine.MonoBehaviour
132
+ {
133
+ public UnityEngine.GameObject @myObject;
134
+ }`
135
+ );
136
+ });
137
+
138
+
139
+
140
+
141
+ it('should generate component with RectTransform reference', () => {
142
+ compareCodegenWithDefaultContext("object",
143
+ // INPUT
144
+ `export class MyComponent extends Behaviour {
145
+ public myRect: RectTransform;
146
+ }
147
+ `,
148
+ // EXPECTED
149
+ `public partial class MyComponent : UnityEngine.MonoBehaviour
150
+ {
151
+ public UnityEngine.RectTransform @myRect;
152
+ }`
153
+ );
154
+ });
155
+
156
+
157
+
123
158
  });
@@ -1 +0,0 @@
1
- {
2
  "MyNew": {
3
1
  }
@@ -1 +0,0 @@
1
- {
2
  "MyTest": {
3
1
  "myMethod": {
4
2
  "type": "fn"
5
3
  }
6
4
  }
@@ -1,4 +0,0 @@
1
- {
2
- "BasicComponent": {
3
- }
4
- }
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- exports.__esModule = true;
18
- exports.BasicComponent = void 0;
19
- var BasicComponent = /** @class */ (function (_super) {
20
- __extends(BasicComponent, _super);
21
- function BasicComponent() {
22
- return _super !== null && _super.apply(this, arguments) || this;
23
- }
24
- return BasicComponent;
25
- }(Behaviour));
26
- exports.BasicComponent = BasicComponent;
@@ -1,3 +0,0 @@
1
- export class BasicComponent extends Behaviour {
2
- }
3
-
@@ -1 +0,0 @@
1
- {
2
  "BasicComponent": {
3
1
  }
@@ -1,8 +0,0 @@
1
- {
2
- "BasicComponent": {
3
- "myFloat": {
4
- "type": "float",
5
- "value": 42
6
- }
7
- }
8
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- exports.__esModule = true;
18
- exports.BasicComponent = void 0;
19
- var BasicComponent = /** @class */ (function (_super) {
20
- __extends(BasicComponent, _super);
21
- function BasicComponent() {
22
- var _this = _super !== null && _super.apply(this, arguments) || this;
23
- _this.myFloat = 42;
24
- return _this;
25
- }
26
- return BasicComponent;
27
- }(Behaviour));
28
- exports.BasicComponent = BasicComponent;
@@ -1,4 +0,0 @@
1
- export class BasicComponent extends Behaviour {
2
- myFloat:number = 42;
3
- }
4
-
@@ -1 +0,0 @@
1
- {
2
  "BasicComponent": {
3
1
  "myFloat": {
4
2
  "type": "float",
5
3
  "value": 42
6
4
  }
7
5
  }
@@ -1,7 +0,0 @@
1
- {
2
- "BasicComponent": {
3
- "animation": {
4
- "type": "comp"
5
- }
6
- }
7
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- exports.__esModule = true;
24
- exports.BasicComponent = void 0;
25
- var BasicComponent = /** @class */ (function (_super) {
26
- __extends(BasicComponent, _super);
27
- function BasicComponent() {
28
- return _super !== null && _super.apply(this, arguments) || this;
29
- }
30
- __decorate([
31
- serializable(Behaviour)
32
- ], BasicComponent.prototype, "animation");
33
- return BasicComponent;
34
- }(Behaviour));
35
- exports.BasicComponent = BasicComponent;
@@ -1,4 +0,0 @@
1
- export class BasicComponent extends Behaviour {
2
- @serializable(Behaviour)
3
- animation : Animation;
4
- }
@@ -1 +0,0 @@
1
- {
2
  "BasicComponent": {
3
1
  "animation": {
4
2
  "type": "animation"
5
3
  }
6
4
  }
@@ -1,7 +0,0 @@
1
- {
2
- "BasicComponent": {
3
- "basicComponent": {
4
- "type": "comp"
5
- }
6
- }
7
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- exports.__esModule = true;
24
- exports.BasicComponent = void 0;
25
- var BasicComponent = /** @class */ (function (_super) {
26
- __extends(BasicComponent, _super);
27
- function BasicComponent() {
28
- return _super !== null && _super.apply(this, arguments) || this;
29
- }
30
- __decorate([
31
- serializable(Behaviour)
32
- ], BasicComponent.prototype, "basicComponent");
33
- return BasicComponent;
34
- }(Behaviour));
35
- exports.BasicComponent = BasicComponent;
@@ -1,5 +0,0 @@
1
- export class BasicComponent extends Behaviour {
2
- @serializable(Behaviour)
3
- basicComponent : Behaviour;
4
- }
5
-
@@ -1 +0,0 @@
1
- {
2
  "BasicComponent": {
3
1
  "basicComponent": {
4
2
  "type": "comp"
5
3
  }
6
4
  }
@@ -1,14 +0,0 @@
1
- // NEEDLE_CODEGEN_START
2
- // auto generated code - do not edit directly
3
-
4
- #pragma warning disable
5
-
6
- namespace Needle.Typescript.GeneratedComponents
7
- {
8
- public partial class MyComponent : UnityEngine.MonoBehaviour
9
- {
10
- public void OnDisable(){}
11
- }
12
- }
13
-
14
- // NEEDLE_CODEGEN_END
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- exports.__esModule = true;
18
- exports.MyComponent = void 0;
19
- var MyComponent = /** @class */ (function (_super) {
20
- __extends(MyComponent, _super);
21
- function MyComponent() {
22
- return _super !== null && _super.apply(this, arguments) || this;
23
- }
24
- MyComponent.prototype.onDisable = function () { };
25
- return MyComponent;
26
- }(Behaviour));
27
- exports.MyComponent = MyComponent;
@@ -1,4 +0,0 @@
1
- export class MyComponent extends Behaviour {
2
- onDisable() {}
3
- }
4
- }
@@ -1,14 +0,0 @@
1
- // NEEDLE_CODEGEN_START
2
- // auto generated code - do not edit directly
3
-
4
- #pragma warning disable
5
-
6
- namespace Needle.Typescript.GeneratedComponents
7
- {
8
- public partial class MyComponent : UnityEngine.MonoBehaviour
9
- {
10
- public void OnDisable(){}
11
- }
12
- }
13
-
14
- // NEEDLE_CODEGEN_END
@@ -1,13 +0,0 @@
1
- // NEEDLE_CODEGEN_START
2
- // auto generated code - do not edit directly
3
-
4
- #pragma warning disable
5
-
6
- namespace Needle.Typescript.GeneratedComponents
7
- {
8
- public partial class BasicComponet : UnityEngine.MonoBehaviour
9
- {
10
- }
11
- }
12
-
13
- // NEEDLE_CODEGEN_END
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- exports.__esModule = true;
18
- exports.BasicComponet = void 0;
19
- var BasicComponet = /** @class */ (function (_super) {
20
- __extends(BasicComponet, _super);
21
- function BasicComponet() {
22
- return _super !== null && _super.apply(this, arguments) || this;
23
- }
24
- return BasicComponet;
25
- }(Behaviour));
26
- exports.BasicComponet = BasicComponet;
@@ -1,2 +0,0 @@
1
- export class BasicComponet extends Behaviour {
2
- }