import i18n from "../../../../i18n/i18n";
import ViewObject from "../../../../main/ViewObject";
import { __StageData } from "../../../data/sdata/SManage";

const {ccclass, property} = cc._decorator;

@ccclass
export default class StageSuccess extends ViewObject {

    @property(cc.Label)
    mLevelName: cc.Label = null;

    public callback:()=>void;

    public init(stageData:__StageData){
        this.mLevelName.string = i18n.t(stageData.name);
    }

    public setCallback(callback:()=>void){
        this.callback = callback;
    }

    public onclickOK(){
        this.exitDistroy();
        if(this.callback){
            this.callback();
        }
    }

}
