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 @@ ...@@ -499,7 +499,7 @@
"node": { "node": {
"__id__": 9 "__id__": 9
}, },
"_enabled": true, "_enabled": false,
"_materials": [ "_materials": [
{ {
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
...@@ -635,7 +635,7 @@ ...@@ -635,7 +635,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
0, 150,
0, 0,
0, 0,
0, 0,
......
...@@ -10,7 +10,8 @@ export default class BuaController extends cc.Component { ...@@ -10,7 +10,8 @@ export default class BuaController extends cc.Component {
private spine: sp.Skeleton = null; private spine: sp.Skeleton = null;
private _count = 0; private _count = 0;
private _actions: Function[] = []; private _actions: Function[] = [];
private _skins = ["Bua", "Ga", "Gai_lung", "Gay"] private _skins = ["Bua", "Ga", "Gai_lung", "Gay"];
private _isPlay = false;
protected onLoad(): void { protected onLoad(): void {
this.spine = this.node.getComponent(sp.Skeleton); this.spine = this.node.getComponent(sp.Skeleton);
...@@ -19,6 +20,7 @@ export default class BuaController extends cc.Component { ...@@ -19,6 +20,7 @@ export default class BuaController extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this); this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this._actions = [this.playAnimationDap1, this.playAnimationDap2, this.playAnimationDap3, this.playAnimationDap4]; this._actions = [this.playAnimationDap1, this.playAnimationDap2, this.playAnimationDap3, this.playAnimationDap4];
this._isPlay = true;
} }
public onSetTool() { public onSetTool() {
...@@ -28,6 +30,7 @@ export default class BuaController extends cc.Component { ...@@ -28,6 +30,7 @@ export default class BuaController extends cc.Component {
private onTouchStart(): void { private onTouchStart(): void {
this._actions[this._count].bind(this)(); this._actions[this._count].bind(this)();
this._count = (this._count + 1) % this._actions.length; this._count = (this._count + 1) % this._actions.length;
} }
......
...@@ -26,14 +26,6 @@ export default class HuController extends cc.Component { ...@@ -26,14 +26,6 @@ export default class HuController extends cc.Component {
this.spine.setCompleteListener(() => this.setRotateAnim()); this.spine.setCompleteListener(() => this.setRotateAnim());
this.scheduleOnce(this.testDevice, 2); this.scheduleOnce(this.testDevice, 2);
// this.scheduleOnce(() => {
// (window.DeviceMotionEvent as any).requestPermission()
// .then(response => {
// this.text.string = (response);
// this.testDevice();
// }
// )
// }, 2);
} }
private testDevice() { private testDevice() {
...@@ -41,7 +33,6 @@ export default class HuController extends cc.Component { ...@@ -41,7 +33,6 @@ export default class HuController extends cc.Component {
if (!event.accelerationIncludingGravity) { if (!event.accelerationIncludingGravity) {
return; return;
} }
this.text.string = 'device motion';
const x = event.accelerationIncludingGravity.x; const x = event.accelerationIncludingGravity.x;
const y = event.accelerationIncludingGravity.y; const y = event.accelerationIncludingGravity.y;
...@@ -61,7 +52,6 @@ export default class HuController extends cc.Component { ...@@ -61,7 +52,6 @@ export default class HuController extends cc.Component {
if (this._count > 0) { if (this._count > 0) {
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.text.string = `lac ` + this._count;
this._count = 0; this._count = 0;
}, 2) }, 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