Commit 01f0c342 authored by Vũ Gia Vương's avatar Vũ Gia Vương

Initial commit

parent 5165324e
Pipeline #5650 canceled with stages
......@@ -96,10 +96,10 @@
"_active": true,
"_components": [
{
"__id__": 82
"__id__": 84
},
{
"__id__": 83
"__id__": 85
}
],
"_prefab": null,
......@@ -3664,12 +3664,15 @@
"_children": [
{
"__id__": 79
},
{
"__id__": 81
}
],
"_active": true,
"_components": [
{
"__id__": 81
"__id__": 83
}
],
"_prefab": null,
......@@ -3801,6 +3804,87 @@
"preload": false,
"_id": "47ldRFoVBIiIz8lx71RIrx"
},
{
"__type__": "cc.Node",
"_name": "Cartoon Short Version 2_01",
"_objFlags": 0,
"_parent": {
"__id__": 78
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 82
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "66zfr5x/VBRLfVG8a4e/gn"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
},
"_enabled": true,
"_clip": {
"__uuid__": "4f4a1f56-3743-4d39-83a3-41c6314e6b4e"
},
"_volume": 0.5,
"_mute": false,
"_loop": true,
"_firstlyEnabled": true,
"playOnLoad": true,
"preload": false,
"_id": "1eeLLVdTNN+a9bjKTz51AH"
},
{
"__type__": "bccdbjIIvVBZoLltHmAttIC",
"_name": "",
......
......@@ -25,19 +25,23 @@ export default class HuController extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this)
this.spine.setCompleteListener(() => this.setRotateAnim());
this.scheduleOnce(() => this.testDevice, 3);
this.scheduleOnce(this.testDevice, 2);
// this.scheduleOnce(() => {
// (window.DeviceMotionEvent as any).requestPermission()
// .then(response => {
// this.text.string = (response);
// this.testDevice();
// }
// )
// }, 2);
}
private testDevice() {
this.text.string = 'testDevice';
console.log('testDevice',)
window.addEventListener("devicemotion", (event) => {
if (!event.accelerationIncludingGravity) {
return;
}
this.text.string = `lac`;
this.text.string = 'device motion';
const x = event.accelerationIncludingGravity.x;
const y = event.accelerationIncludingGravity.y;
......@@ -57,8 +61,9 @@ export default class HuController extends cc.Component {
if (this._count > 0) {
this.scheduleOnce(() => {
this.text.string = `lac ` + this._count;
this._count = 0;
}, 1.5)
}, 2)
}
if (this._count > 5) {
......@@ -84,7 +89,7 @@ export default class HuController extends cc.Component {
}
private onTouchStart(event: cc.Event.EventTouch): void {
console.log('onTouchStart', )
console.log('onTouchStart',)
if (!this._pointStart) {
this.setRotateAnim();
}
......
......@@ -11,13 +11,15 @@ export default class ActionScreen extends cc.Component {
private bottleAction: cc.Node = null;
private _buaController: BuaController = null;
private _spine: sp.Skeleton = null;
onLoad() {
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
eventTarget.on(PLAY_ANIM_NUT1, this.hideBottle, this);
this._buaController = this.getComponentInChildren(BuaController);
// this.node.active = false;
this._spine = this.bottleIdle.getComponent(sp.Skeleton);
}
private hideBottle() {
......@@ -28,6 +30,7 @@ export default class ActionScreen extends cc.Component {
private showScreen() {
this.bottleAction.active = false;
this.bottleIdle.active = true;
this._spine.setAnimation(0, 'Idle', true);
this.node.active = true;
this._buaController.onSetTool();
......
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