Complete Cocos Creator port with level bundles, themes, and tooling.
Adds level prefabs, theme assets, audio, extensions, and deployment scripts for the Unity WebGL migration. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
import { setColor } from "../common/utlis";
|
||||
|
||||
export const LABELOUTLINE = {
|
||||
"__type__": "cc.LabelOutline",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": null,
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255,
|
||||
},
|
||||
"_width": 2,
|
||||
};
|
||||
|
||||
export class LabelOutline {
|
||||
|
||||
static create() {
|
||||
return JSON.parse(JSON.stringify(LABELOUTLINE));
|
||||
}
|
||||
|
||||
static async migrate(json2D: any, json3D: any) {
|
||||
const source = JSON.parse(JSON.stringify(LABELOUTLINE));
|
||||
for (const key in json2D) {
|
||||
const value = json2D[key];
|
||||
if (key === '__type__' || value === undefined || value === null) { continue; }
|
||||
if (key === 'node') {
|
||||
source.node = value;
|
||||
setColor(source, value.__id__, json2D);
|
||||
}
|
||||
else {
|
||||
source[key] = value;
|
||||
}
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
static async apply(index: number, json2D: any, json3D: any) {
|
||||
const source = await LabelOutline.migrate(json2D[index], json3D);
|
||||
json3D.splice(index, 1, source);
|
||||
return source;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user