import { _decorator, Component, Node, tween, Vec3 } from 'cc'; const { ccclass, property } = _decorator; @ccclass('Test') export class Test extends Component { @property({ type: Node, tooltip: "test" }) testNode: Node; start() { // systemEvent.setAccelerometerEnabled(true); // systemEvent.on(SystemEventType.DEVICEMOTION, this.onDeviceMotionEvent, this); } private onButon() { tween(this.testNode). to(0.5, { position: new Vec3(1, 1, 0) }, { easing: "bounceOutIn" }). delay(0.5).call(() => { this.testNode.position = new Vec3(100, 100, 0); }). // to(0.5, { position: new Vec3(100, 100, 1,) }, { easing: "bounceInOut" }). // to(0.15, { position: v1 }, { easing: "sineOut" }). // to(0.2, { position: v3 }, { easing: "sineIn" }). // to(0.05, { position: nowPostion }, { easing: "sineIn" }). start(); } onDestroy() { // systemEvent.off(SystemEventType.DEVICEMOTION, this.onDeviceMotionEvent, this); // } // onDeviceMotionEvent(event: EventAcceleration) { // console.log(event.acc.x + " " + event.acc.y); // } } }