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,38 @@
import { _decorator, Component, Label } from 'cc';
const { ccclass, property } = _decorator;
import { MapCityData } from "../MapCityProxy";
import { EventMgr } from '../../utils/EventMgr';
@ccclass('RightCityItemLogic')
export default class RightCityItemLogic extends Component {
@property(Label)
labelInfo: Label = null;
@property(Label)
labelPos: Label = null;
protected _data: MapCityData = null;
protected onLoad(): void {
}
protected onDestroy(): void {
this._data = null;
}
protected onClickBg(): void {
if (this._data) {
EventMgr.emit("scroll_to_map", this._data.x, this._data.y);
}
}
public setArmyData(data: MapCityData): void {
this._data = data;
if (this._data) {
this.labelInfo.string = this._data.name;
this.labelPos.string = "(" + this._data.x + ", " + this._data.y + ")";
}
}
}