Commit 42e9787f authored by Vũ Gia Vương's avatar Vũ Gia Vương

clear text test

parent e57bca8c
Pipeline #5652 canceled with stages
......@@ -499,7 +499,7 @@
"node": {
"__id__": 9
},
"_enabled": true,
"_enabled": false,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
......@@ -635,7 +635,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
150,
0,
0,
0,
......
......@@ -10,7 +10,8 @@ export default class BuaController extends cc.Component {
private spine: sp.Skeleton = null;
private _count = 0;
private _actions: Function[] = [];
private _skins = ["Bua", "Ga", "Gai_lung", "Gay"]
private _skins = ["Bua", "Ga", "Gai_lung", "Gay"];
private _isPlay = false;
protected onLoad(): void {
this.spine = this.node.getComponent(sp.Skeleton);
......@@ -19,6 +20,7 @@ export default class BuaController extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this._actions = [this.playAnimationDap1, this.playAnimationDap2, this.playAnimationDap3, this.playAnimationDap4];
this._isPlay = true;
}
public onSetTool() {
......@@ -28,6 +30,7 @@ export default class BuaController extends cc.Component {
private onTouchStart(): void {
this._actions[this._count].bind(this)();
this._count = (this._count + 1) % this._actions.length;
}
......
......@@ -26,14 +26,6 @@ export default class HuController extends cc.Component {
this.spine.setCompleteListener(() => this.setRotateAnim());
this.scheduleOnce(this.testDevice, 2);
// this.scheduleOnce(() => {
// (window.DeviceMotionEvent as any).requestPermission()
// .then(response => {
// this.text.string = (response);
// this.testDevice();
// }
// )
// }, 2);
}
private testDevice() {
......@@ -41,7 +33,6 @@ export default class HuController extends cc.Component {
if (!event.accelerationIncludingGravity) {
return;
}
this.text.string = 'device motion';
const x = event.accelerationIncludingGravity.x;
const y = event.accelerationIncludingGravity.y;
......@@ -61,7 +52,6 @@ export default class HuController extends cc.Component {
if (this._count > 0) {
this.scheduleOnce(() => {
this.text.string = `lac ` + this._count;
this._count = 0;
}, 2)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment