import { _decorator, Component, Node, Sprite } from 'cc';
import { GameManager } from '../../GameManager';
import { base_ui } from '../../fw/base_ui';
import { uiManager } from '../../manager/uiManager';
import { config } from '../../config';
import { dataManager } from '../../manager/dataManager';
const { ccclass, property } = _decorator;

@ccclass('home_car')
export class home_car extends base_ui {
    @property(Node) spr_car:Node = null
    protected start(): void {
        uiManager.Instance().onButtonListen(this.spr_car, ()=>{
            this.node.parent.active = false
            uiManager.Instance().showUi(config.UI.car_lib, null, ()=>{
                this.node.parent.active = true
            })
        })
    }

    updateCar(){
        this.spr_car.getComponent(Sprite).spriteFrame = dataManager.getUserDefaultHomeCarSf()
    }
}


