30 lines
776 B
TypeScript
Raw Normal View History

2023-11-13 02:37:29 +08:00
import { _decorator, Component, Label, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { sp } from 'cc';
import PlayerPetData from '../../data/PlayerPetData';
import { GUI } from '../UIConfig';
import { UIPetAnim } from '../../consts/GData';
const { ccclass, property } = _decorator;
@ccclass('MainView')
export class MainView extends JNGLayerBase {
//宠物
@property(sp.Skeleton)
spine:sp.Skeleton;
onJNLoad(data?: any): void {
//显示被选择的宠物
this.spine.skeletonData = app.battleRes.roleSpine[PlayerPetData.getIns().getData()[0].petTbId];
this.spine.setAnimation(0,UIPetAnim.std,true);
}
//点击回到之前的主页
onClickHome(){
app.layer.Open(GUI.Home);
}
}