@openfairygui/functions 0.1.0
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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/index.cjs +3110 -0
- package/dist/index.d.cts +422 -0
- package/dist/index.d.ts +422 -0
- package/dist/index.js +3099 -0
- package/package.json +54 -0
- package/src/atlas.ts +1651 -0
- package/src/codegen-templates.ts +67 -0
- package/src/codegen.ts +656 -0
- package/src/index.ts +26 -0
- package/src/inspect.ts +146 -0
- package/src/max-rects-compat.ts +431 -0
- package/src/max-rects-packer-compat.ts +412 -0
- package/src/prune.ts +86 -0
- package/src/publish.ts +1093 -0
- package/src/rename.ts +66 -0
- package/src/shared-types.ts +65 -0
- package/src/utils.ts +9 -0
- package/src/validate.ts +186 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const UNITY_COMPONENT_TEMPLATE = `{{generatedMark}}
|
|
2
|
+
|
|
3
|
+
using FairyGUI;
|
|
4
|
+
using FairyGUI.Utils;
|
|
5
|
+
|
|
6
|
+
namespace {{namespaceName}}
|
|
7
|
+
{
|
|
8
|
+
\tpublic partial class {{className}} : {{componentType}}
|
|
9
|
+
\t{
|
|
10
|
+
\t\tpublic const string URL = "{{url}}";
|
|
11
|
+
{{variableLines}}
|
|
12
|
+
\t\tpublic static {{className}} CreateInstance()
|
|
13
|
+
\t\t{
|
|
14
|
+
\t\t\treturn ({{className}})UIPackage.CreateObject("{{packageName}}", "{{componentName}}");
|
|
15
|
+
\t\t}
|
|
16
|
+
|
|
17
|
+
\t\tpublic override void ConstructFromXML(XML xml)
|
|
18
|
+
\t\t{
|
|
19
|
+
\t\t\tbase.ConstructFromXML(xml);
|
|
20
|
+
{{assignmentLines}}
|
|
21
|
+
\t\t}
|
|
22
|
+
\t}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const UNITY_BINDER_TEMPLATE = `{{generatedMark}}
|
|
27
|
+
|
|
28
|
+
using FairyGUI;
|
|
29
|
+
|
|
30
|
+
namespace {{namespaceName}}
|
|
31
|
+
{
|
|
32
|
+
\tpublic static class {{binderClassName}}
|
|
33
|
+
\t{
|
|
34
|
+
\t\tpublic static void BindAll()
|
|
35
|
+
\t\t{
|
|
36
|
+
{{bindLines}}
|
|
37
|
+
\t\t}
|
|
38
|
+
\t}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const FGUI_TYPESCRIPT_COMPONENT_TEMPLATE = `{{generatedMark}}
|
|
43
|
+
|
|
44
|
+
{{importLines}}export default class {{className}} extends {{componentType}}
|
|
45
|
+
{
|
|
46
|
+
\tpublic static URL:string = "{{url}}";
|
|
47
|
+
{{variableLines}}
|
|
48
|
+
\tpublic static createInstance():{{className}}
|
|
49
|
+
\t{
|
|
50
|
+
\t\treturn <{{className}}><any>({{runtimeNamespace}}.UIPackage.createObject("{{packageName}}","{{componentName}}"));
|
|
51
|
+
\t}
|
|
52
|
+
|
|
53
|
+
\tprotected onConstruct():void
|
|
54
|
+
\t{
|
|
55
|
+
{{assignmentLines}}\t}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const FGUI_TYPESCRIPT_BINDER_TEMPLATE = `{{generatedMark}}
|
|
60
|
+
|
|
61
|
+
{{importLines}}export default class {{binderClassName}}
|
|
62
|
+
{
|
|
63
|
+
\tpublic static bindAll():void
|
|
64
|
+
\t{
|
|
65
|
+
{{bindLines}}\t}
|
|
66
|
+
}
|
|
67
|
+
`;
|