first commit

This commit is contained in:
ytc1012
2025-11-18 18:38:53 +08:00
commit bea9db4488
1582 changed files with 335346 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { _decorator, Component, Label, Node } from 'cc';
const { ccclass, property } = _decorator;
import UnionCommand from "./UnionCommand";
import { Union } from "./UnionProxy";
import { EventMgr } from '../utils/EventMgr';
@ccclass('UnionItemLogic')
export default class UnionItemLogic extends Component {
@property(Label)
nameLabel: Label | null = null;
@property(Node)
joinButtonNode: Node | null = null;
protected _unionData:Union = null;
protected onLoad():void{
this.joinButtonNode.active = false;
}
protected updateItem(data:Union):void{
this._unionData = data;
this.nameLabel.string = this._unionData.name;
this.joinButtonNode.active = this.isCanJoin();
}
protected isCanJoin():boolean{
return !UnionCommand.getInstance().proxy.isMeInUnion();
}
protected join():void{
UnionCommand.getInstance().unionJoin(this._unionData.id)
}
protected click():void{
var isCanjoin:boolean = this.isCanJoin();
if(!isCanjoin){
EventMgr.emit("open_my_union",this._unionData)
}
}
}