From 7b603046eb89171df3eeeb3f3677540988fc3f65 Mon Sep 17 00:00:00 2001 From: Leslie Date: Mon, 14 Jan 2019 16:43:57 +0800 Subject: [PATCH 1/2] skeleton.js: rename autofmt --- cocos/3d/assets/{skeleton.js => skeleton.ts} | 73 ++++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) rename cocos/3d/assets/{skeleton.js => skeleton.ts} (69%) diff --git a/cocos/3d/assets/skeleton.js b/cocos/3d/assets/skeleton.ts similarity index 69% rename from cocos/3d/assets/skeleton.js rename to cocos/3d/assets/skeleton.ts index a7679f2906..400b58a1d0 100644 --- a/cocos/3d/assets/skeleton.js +++ b/cocos/3d/assets/skeleton.ts @@ -23,11 +23,10 @@ THE SOFTWARE. ****************************************************************************/ -// @ts-check -import { _decorator } from "../../core/data"; +import { _decorator } from '../../core/data'; const { ccclass, property } = _decorator; -import { Asset } from "../../assets/asset"; -import { Mat4 } from "../../core/value-types"; +import { Asset } from '../../assets/asset'; +import { Mat4 } from '../../core/value-types'; /** * CLASS Skeleton @@ -40,42 +39,42 @@ import { Mat4 } from "../../core/value-types"; */ @ccclass('cc.Skeleton') export default class Skeleton extends Asset { - /** - * The path of joints. - * @type {string[]} - */ - @property([String]) - _joints = []; + /** + * The path of joints. + * @type {string[]} + */ + @property([String]) + public _joints = []; - /** - * The inverse bind matrices of joints. - * @type {Mat4[]} - */ - @property([Mat4]) - _inverseBindMatrices = []; + /** + * The inverse bind matrices of joints. + * @type {Mat4[]} + */ + @property([Mat4]) + public _inverseBindMatrices = []; - /** - * Gets the bind pose matrices of joints. - * @type {Mat4[]} - */ - get bindposes() { - return this._inverseBindMatrices; - } + /** + * Gets the bind pose matrices of joints. + * @type {Mat4[]} + */ + get bindposes () { + return this._inverseBindMatrices; + } - /** - * Sets the bind pose matrices of joints. - * @type {Mat4[]} - */ - set bindposes(value) { - this._inverseBindMatrices = value; - } + /** + * Sets the bind pose matrices of joints. + * @type {Mat4[]} + */ + set bindposes (value) { + this._inverseBindMatrices = value; + } - /** - * Gets the paths of joints. - * @type {string[]} - */ - get joints() { - return this._joints; - } + /** + * Gets the paths of joints. + * @type {string[]} + */ + get joints () { + return this._joints; + } } cc.Skeleton = Skeleton; From 2a8a98762475dfe8fa2228eaa2d2f228db8dbfeb Mon Sep 17 00:00:00 2001 From: Leslie Date: Mon, 14 Jan 2019 16:48:12 +0800 Subject: [PATCH 2/2] ts-ing skeleton --- cocos/3d/assets/skeleton.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cocos/3d/assets/skeleton.ts b/cocos/3d/assets/skeleton.ts index 400b58a1d0..e3d9d5806d 100644 --- a/cocos/3d/assets/skeleton.ts +++ b/cocos/3d/assets/skeleton.ts @@ -41,21 +41,18 @@ import { Mat4 } from '../../core/value-types'; export default class Skeleton extends Asset { /** * The path of joints. - * @type {string[]} */ @property([String]) - public _joints = []; + private _joints: string[] = []; /** * The inverse bind matrices of joints. - * @type {Mat4[]} */ @property([Mat4]) - public _inverseBindMatrices = []; + private _inverseBindMatrices: Mat4[] = []; /** * Gets the bind pose matrices of joints. - * @type {Mat4[]} */ get bindposes () { return this._inverseBindMatrices; @@ -63,7 +60,6 @@ export default class Skeleton extends Asset { /** * Sets the bind pose matrices of joints. - * @type {Mat4[]} */ set bindposes (value) { this._inverseBindMatrices = value; @@ -71,10 +67,18 @@ export default class Skeleton extends Asset { /** * Gets the paths of joints. - * @type {string[]} */ get joints () { return this._joints; } + + /** + * Sets the paths of joints. + */ + set joints (value) { + this._joints = value; + } } -cc.Skeleton = Skeleton; + +// tslint:disable-next-line +cc['Skeleton'] = Skeleton;