import { _decorator, Component, Node } from 'cc'; import PlayerTacticalData from '../../../data/PlayerTacticalData'; import { app } from '../../../App'; import { GUI } from '../../UIConfig'; const { ccclass, property } = _decorator; @ccclass('PlayerTacticalItem') export class PlayerTacticalItem extends Component { //阵法的Index; index:number; //初始化阵法 onInit(index:number){ this.index = index; } //更新信息 onUpdateView(){ PlayerTacticalData.getIns().getItem(this.index); } //点击 onClick(){ app.layer.Open(GUI.IntoBattleView); } }