import { _decorator, Component, Node, v3, Vec3, tweenUtil, ButtonComponent } from "cc";
import { UIattribute } from "./UIattribute";
import { UItool } from "./UITool";
const { ccclass, property } = _decorator;

@ccclass("SettingControl")
export class SettingControl extends Component {
    @property({ type: Node })
    public homepage: Node = null;


    private backBtn: ButtonComponent = null;

    onLoad() {
        /**获取按钮组件 */
        this.backBtn = this.node.getChildByName("backBtn").getComponent(ButtonComponent);
        /**按钮监听 */
        this.backBtn.node.on("click", this.settingMove, this);
    }

    settingMove() {
        this.node.active = false;
        this.homepage.active = true;
    }

    onDisable() {
        /**获取按钮组件 */
        this.backBtn = this.node.getChildByName("backBtn").getComponent(ButtonComponent);
        /**按钮监听 */
        this.backBtn.node.on("click", this.settingMove, this);
    }



}

