import { _decorator, Component, Node, Vec3, director } from "cc";
const { ccclass, property } = _decorator;

@ccclass("groundMove")
export class groundMove extends Component {

    //障碍物移动速度
    @property(Number)
    groundSpeed:number=10;

    /* class member could be defined like this */
    // dummy = '';

    /* use `property` decorator if your want the member to be serializable */
    // @property
    // serializableDummy = 0;

    start () {
        // Your initialization goes here.
            //cc.director.getCollisionManger().enabled=true;
    }


    // update (deltaTime: number) {
    //     // Your update function goes here.
    // }
    update(deltaTime:number)
    {
        var e=this.node.getPosition();
        e.z+=deltaTime*this.groundSpeed;
        this.node.setPosition(e.x,e.y,e.z)
    }
}
