@needle-tools/needle-component-compiler 1.9.1 → 1.9.2
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.
- package/Changelog.md +4 -0
- package/package.json +1 -1
- package/schemes/MyNew.component.json +1 -0
- package/schemes/MyTest.component.json +1 -0
- package/src/component-compiler.js +6 -3
- package/src/component-compiler.ts +7 -4
- package/src/test.js +1 -1
- package/src/test.ts +1 -1
- package/test/blender/codegen/basic/expected.component.json +4 -0
- package/test/blender/codegen/basic/input.js +26 -0
- package/test/blender/codegen/basic/input.ts +3 -0
- package/test/blender/codegen/basic/output.component.json +1 -0
- package/test/blender/codegen/float field/expected.component.json +8 -0
- package/test/blender/codegen/float field/input.js +28 -0
- package/test/blender/codegen/float field/input.ts +4 -0
- package/test/blender/codegen/float field/output.component.json +1 -0
- package/test/blender/codegen/reference_animation/expected.component.json +7 -0
- package/test/blender/codegen/reference_animation/input.js +35 -0
- package/test/blender/codegen/reference_animation/input.ts +4 -0
- package/test/blender/codegen/reference_animation/output.component.json +1 -0
- package/test/blender/codegen/reference_behaviour/expected.component.json +7 -0
- package/test/blender/codegen/reference_behaviour/input.js +35 -0
- package/test/blender/codegen/reference_behaviour/input.ts +5 -0
- package/test/blender/codegen/reference_behaviour/output.component.json +1 -0
- package/test/component.basic.test.ts +1 -0
- package/test/csharp/codegen/abstract method/expected.cs +14 -0
- package/test/csharp/codegen/abstract method/input.js +27 -0
- package/test/csharp/codegen/abstract method/input.ts +4 -0
- package/test/csharp/codegen/abstract method/output.cs +14 -0
- package/test/csharp/codegen/basic/expected.cs +13 -0
- package/test/csharp/codegen/basic/input.js +26 -0
- package/test/csharp/codegen/basic/input.ts +2 -0
- package/test/csharp/codegen/basic/output.cs +13 -0
- package/test/csharp/codegen/basic-no-export/expected.cs +0 -0
- package/test/csharp/codegen/basic-no-export/input.js +27 -0
- package/test/csharp/codegen/basic-no-export/input.ts +4 -0
- package/test/csharp/codegen/basic-no-export/output.cs +0 -0
- package/test/csharp/codegen/bool/expected.cs +14 -0
- package/test/csharp/codegen/bool/input.js +26 -0
- package/test/csharp/codegen/bool/input.ts +3 -0
- package/test/csharp/codegen/bool/output.cs +14 -0
- package/test/csharp/codegen/fields with default values/expected.cs +18 -0
- package/test/csharp/codegen/fields with default values/input.js +32 -0
- package/test/csharp/codegen/fields with default values/input.ts +7 -0
- package/test/csharp/codegen/fields with default values/output.cs +18 -0
- package/test/csharp/codegen/method ignore inline type declaration/expected.cs +14 -0
- package/test/csharp/codegen/method ignore inline type declaration/input.js +27 -0
- package/test/csharp/codegen/method ignore inline type declaration/input.ts +3 -0
- package/test/csharp/codegen/method ignore inline type declaration/output.cs +14 -0
- package/test/csharp/codegen/nonserialized ignore field/expected.cs +13 -0
- package/test/csharp/codegen/nonserialized ignore field/input.js +26 -0
- package/test/csharp/codegen/nonserialized ignore field/input.ts +4 -0
- package/test/csharp/codegen/nonserialized ignore field/output.cs +13 -0
- package/test/csharp/codegen/nonserialized on property does not affect method/expected.cs +14 -0
- package/test/csharp/codegen/nonserialized on property does not affect method/input.js +34 -0
- package/test/csharp/codegen/nonserialized on property does not affect method/input.ts +8 -0
- package/test/csharp/codegen/nonserialized on property does not affect method/output.cs +13 -0
- package/test/csharp/codegen/number/expected.cs +14 -0
- package/test/csharp/codegen/number/input.js +26 -0
- package/test/csharp/codegen/number/input.ts +3 -0
- package/test/csharp/codegen/number/output.cs +14 -0
- package/test/csharp/codegen/object/expected.cs +14 -0
- package/test/csharp/codegen/object/input.js +26 -0
- package/test/csharp/codegen/object/input.ts +3 -0
- package/test/csharp/codegen/object/output.cs +14 -0
- package/test/csharp/codegen/private.methods/expected.cs +13 -0
- package/test/csharp/codegen/private.methods/input.js +27 -0
- package/test/csharp/codegen/private.methods/input.ts +3 -0
- package/test/csharp/codegen/private.methods/output.cs +13 -0
- package/test/csharp/codegen/protected.methods/expected.cs +13 -0
- package/test/csharp/codegen/protected.methods/input.js +27 -0
- package/test/csharp/codegen/protected.methods/input.ts +3 -0
- package/test/csharp/codegen/protected.methods/output.cs +13 -0
- package/test/csharp/codegen/public method with args/expected.cs +14 -0
- package/test/csharp/codegen/public method with args/input.js +27 -0
- package/test/csharp/codegen/public method with args/input.ts +3 -0
- package/test/csharp/codegen/public method with args/output.cs +14 -0
- package/test/csharp/codegen/public method with multiple args/expected.cs +14 -0
- package/test/csharp/codegen/public method with multiple args/input.js +27 -0
- package/test/csharp/codegen/public method with multiple args/input.ts +3 -0
- package/test/csharp/codegen/public method with multiple args/output.cs +14 -0
- package/test/csharp/codegen/public.methods/expected.cs +14 -0
- package/test/csharp/codegen/public.methods/input.js +27 -0
- package/test/csharp/codegen/public.methods/input.ts +3 -0
- package/test/csharp/codegen/public.methods/output.cs +14 -0
- package/test/csharp/codegen/static method/expected.cs +13 -0
- package/test/csharp/codegen/static method/input.js +27 -0
- package/test/csharp/codegen/static method/input.ts +3 -0
- package/test/csharp/codegen/static method/output.cs +14 -0
- package/test/csharp/codegen/string/expected.cs +14 -0
- package/test/csharp/codegen/string/input.js +26 -0
- package/test/csharp/codegen/string/input.ts +3 -0
- package/test/csharp/codegen/string/output.cs +14 -0
- package/test/csharp/codegen/stringArray/expected.cs +14 -0
- package/test/csharp/codegen/stringArray/input.js +26 -0
- package/test/csharp/codegen/stringArray/input.ts +3 -0
- package/test/csharp/codegen/stringArray/output.cs +14 -0
- package/workspace.code-workspace +11 -11
package/Changelog.md
CHANGED
|
@@ -4,6 +4,10 @@ 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.2] - 2022-11-29
|
|
8
|
+
- Fix codegen deleting code added manually outside of codegen sections
|
|
9
|
+
- Fix codegen creating output directory if it does not exist yet
|
|
10
|
+
|
|
7
11
|
## [1.9.1] - 2022-11-05
|
|
8
12
|
- Fix ``new Vector2(1, .5)`` generating invalid C# where number arguments were emitted as double instead of float
|
|
9
13
|
|
package/package.json
CHANGED
|
@@ -95,9 +95,11 @@ var ExportContext = /** @class */ (function () {
|
|
|
95
95
|
this.textBuffer = CODEGEN_MARKER_START + "\n" + this.textBuffer + "\n" + CODEGEN_MARKER_END;
|
|
96
96
|
var code = this.textBuffer;
|
|
97
97
|
if (this.outputDir !== null) {
|
|
98
|
+
if (!fs.existsSync(this.outputDir))
|
|
99
|
+
fs.mkdirSync(this.outputDir);
|
|
98
100
|
var dir = this.outputDir + "/";
|
|
99
101
|
var path_1 = dir + this.fileName;
|
|
100
|
-
this.replaceGeneratedCodeSection(path_1);
|
|
102
|
+
code = this.replaceGeneratedCodeSection(path_1, code);
|
|
101
103
|
if (allowDebugLogs)
|
|
102
104
|
console.log("Write to " + path_1);
|
|
103
105
|
fs.writeFileSync(path_1, code);
|
|
@@ -109,7 +111,7 @@ var ExportContext = /** @class */ (function () {
|
|
|
109
111
|
this.textBuffer = "";
|
|
110
112
|
this.classEnd = -1;
|
|
111
113
|
};
|
|
112
|
-
ExportContext.prototype.replaceGeneratedCodeSection = function (path) {
|
|
114
|
+
ExportContext.prototype.replaceGeneratedCodeSection = function (path, code) {
|
|
113
115
|
if (fs.existsSync(path)) {
|
|
114
116
|
var existing = fs.readFileSync(path, "utf8");
|
|
115
117
|
var regex = new RegExp("(?<before>.*?)\/\/ ?NEEDLE_CODEGEN_START.+\/\/ ?NEEDLE_CODEGEN_END(?<after>.*)", "s");
|
|
@@ -119,9 +121,10 @@ var ExportContext = /** @class */ (function () {
|
|
|
119
121
|
console.log("Found codegen sections");
|
|
120
122
|
var before_1 = matches.groups.before;
|
|
121
123
|
var after_1 = matches.groups.after;
|
|
122
|
-
|
|
124
|
+
return before_1 + code + after_1;
|
|
123
125
|
}
|
|
124
126
|
}
|
|
127
|
+
return code;
|
|
125
128
|
};
|
|
126
129
|
return ExportContext;
|
|
127
130
|
}());
|
|
@@ -112,11 +112,13 @@ class ExportContext {
|
|
|
112
112
|
flush(): string {
|
|
113
113
|
if (this.textBuffer.length <= 0) return;
|
|
114
114
|
this.textBuffer = CODEGEN_MARKER_START + "\n" + this.textBuffer + "\n" + CODEGEN_MARKER_END;
|
|
115
|
-
|
|
115
|
+
let code = this.textBuffer;
|
|
116
116
|
if (this.outputDir !== null) {
|
|
117
|
+
if(!fs.existsSync(this.outputDir))
|
|
118
|
+
fs.mkdirSync(this.outputDir);
|
|
117
119
|
const dir = this.outputDir + "/";
|
|
118
120
|
const path = dir + this.fileName;
|
|
119
|
-
this.replaceGeneratedCodeSection(path);
|
|
121
|
+
code = this.replaceGeneratedCodeSection(path, code);
|
|
120
122
|
if (allowDebugLogs)
|
|
121
123
|
console.log("Write to " + path);
|
|
122
124
|
fs.writeFileSync(path, code);
|
|
@@ -130,7 +132,7 @@ class ExportContext {
|
|
|
130
132
|
this.classEnd = -1;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
private replaceGeneratedCodeSection(path: string) {
|
|
135
|
+
private replaceGeneratedCodeSection(path: string, code:string) {
|
|
134
136
|
if (fs.existsSync(path)) {
|
|
135
137
|
const existing = fs.readFileSync(path, "utf8");
|
|
136
138
|
const regex = new RegExp("(?<before>.*?)\/\/ ?NEEDLE_CODEGEN_START.+\/\/ ?NEEDLE_CODEGEN_END(?<after>.*)", "s");
|
|
@@ -140,9 +142,10 @@ class ExportContext {
|
|
|
140
142
|
console.log("Found codegen sections")
|
|
141
143
|
const before = matches.groups.before;
|
|
142
144
|
const after = matches.groups.after;
|
|
143
|
-
|
|
145
|
+
return before + code + after;
|
|
144
146
|
}
|
|
145
147
|
}
|
|
148
|
+
return code;
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
|
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.
|
|
23
|
+
_this.myVecgfdsgtor2 = new Vector2(1, .5);
|
|
24
24
|
return _this;
|
|
25
25
|
}
|
|
26
26
|
MyTestComponent.prototype.myMethod = function () {
|
package/src/test.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
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;
|
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1,26 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
//@dont-generate-component
|
|
20
|
+
var BasicComponet = /** @class */ (function (_super) {
|
|
21
|
+
__extends(BasicComponet, _super);
|
|
22
|
+
function BasicComponet() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return BasicComponet;
|
|
26
|
+
}(Behaviour));
|
|
27
|
+
exports.BasicComponet = BasicComponet;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
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 bool @myField;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// NEEDLE_CODEGEN_END
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
return MyComponent;
|
|
25
|
+
}(Behaviour));
|
|
26
|
+
exports.MyComponent = MyComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
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 bool @myField;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// NEEDLE_CODEGEN_END
|
|
@@ -0,0 +1,18 @@
|
|
|
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 float @myField = 42f;
|
|
11
|
+
public string @myField2 = "hello";
|
|
12
|
+
public bool @myField3 = true;
|
|
13
|
+
public UnityEngine.Object @myField4;
|
|
14
|
+
public UnityEngine.Vector2 @myVector2 = new UnityEngine.Vector2(1f,.5f);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// NEEDLE_CODEGEN_END
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
_this.myField = 42;
|
|
24
|
+
_this.myField2 = "hello";
|
|
25
|
+
_this.myField3 = true;
|
|
26
|
+
_this.myField4 = null;
|
|
27
|
+
_this.myVector2 = new Vector2(1, .5);
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
return MyComponent;
|
|
31
|
+
}(Behaviour));
|
|
32
|
+
exports.MyComponent = MyComponent;
|