RotaterView.ts 815 Bytes
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import { RotaterObj } from "../kernel/battle/map/RotaterObj";
import ObjBaseView from "./ObjBaseView";

const { ccclass, property } = cc._decorator;

@ccclass
export default class RotaterView extends ObjBaseView {

    //#region life cycle

    protected update(dt: number): void {
        super.update(dt);

        if (this._visible) {

            this._img.angle = (this.owner as RotaterObj).angle;
            this.node.angle = (this.owner as RotaterObj).angle;
        }
    }

    //#endregion
}