import { _decorator, Component, Node } from 'cc';
import { EditBox } from 'cc';
import { API } from '../../consts/API';
import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App';
const { ccclass, property } = _decorator;

@ccclass('NoviceNamingView')
export class NoviceNamingView extends JNGLayerBase {
    
    @property(EditBox)
    text:EditBox;

    //保存名称
    async onSave(){
        if(this.text.string){
            await API.SavePlayerInfo(this.text.string);
            //关闭页面
            app.layer.CloseNode(this.node);
        }
    }

}


