first commit
This commit is contained in:
33
assets/scripts/union/UnionLobbyLogic.ts
Normal file
33
assets/scripts/union/UnionLobbyLogic.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { _decorator, Component, ScrollView } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
import UnionCommand from "./UnionCommand";
|
||||
import { Union } from "./UnionProxy";
|
||||
import { EventMgr } from '../utils/EventMgr';
|
||||
|
||||
@ccclass('UnionLobbyLogic')
|
||||
export default class UnionLobbyLogic extends Component {
|
||||
@property(ScrollView)
|
||||
scrollView:ScrollView | null = null;
|
||||
private _isFrist:boolean = false;
|
||||
protected onLoad():void{
|
||||
EventMgr.on("update_union_list",this.updateUnion,this);
|
||||
}
|
||||
|
||||
protected onDestroy():void{
|
||||
EventMgr.targetOff(this);
|
||||
}
|
||||
protected updateUnion(data:any[]){
|
||||
var comp = this.scrollView.node.getComponent("ListLogic");
|
||||
var list:Union[] = UnionCommand.getInstance().proxy.getUnionList();
|
||||
comp.setData(list);
|
||||
}
|
||||
protected onEnable():void{
|
||||
this._isFrist = true;
|
||||
UnionCommand.getInstance().unionList();
|
||||
}
|
||||
protected onDisable():void{
|
||||
this._isFrist = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user