|
|
|
@ -342,6 +342,7 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
onUpdate() { |
|
|
|
|
this.updateUVAnim(); |
|
|
|
|
this.updateLimitCameraY(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -553,47 +554,58 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (allModelNumber > 1) { |
|
|
|
|
//暂时关闭 1+ n的加载模式
|
|
|
|
|
// if (allModelNumber > 1) {
|
|
|
|
|
|
|
|
|
|
if (firstType == BuildingType.Environment) { |
|
|
|
|
instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => { |
|
|
|
|
instance.onChangeCurrentBuildingItem(uiItem, false); |
|
|
|
|
// uiItem.lookAt(false);
|
|
|
|
|
if (buildingDatas_Environment.length > 1) { |
|
|
|
|
instance.addBuildings(BuildingType.Environment, 1); |
|
|
|
|
} |
|
|
|
|
// if (firstType == BuildingType.Environment) {
|
|
|
|
|
// instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => {
|
|
|
|
|
// instance.onChangeCurrentBuildingItem(uiItem, false);
|
|
|
|
|
// // uiItem.lookAt(false);
|
|
|
|
|
// if (buildingDatas_Environment.length > 1) {
|
|
|
|
|
// instance.addBuildings(BuildingType.Environment, 1);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
instance.addBuildings(BuildingType.Normal, 0); |
|
|
|
|
// instance.addBuildings(BuildingType.Normal, 0);
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => { |
|
|
|
|
instance.onChangeCurrentBuildingItem(uiItem, false); |
|
|
|
|
// uiItem.lookAt(false);
|
|
|
|
|
if (buildingDatas_mormal.length > 1) { |
|
|
|
|
instance.addBuildings(BuildingType.Normal, 1); |
|
|
|
|
} |
|
|
|
|
instance.addBuildings(BuildingType.Environment, 0); |
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// instance.createOneBuildingItem(firstItem, 0, (uiItem, index) => {
|
|
|
|
|
// instance.onChangeCurrentBuildingItem(uiItem, false);
|
|
|
|
|
// // uiItem.lookAt(false);
|
|
|
|
|
// if (buildingDatas_mormal.length > 1) {
|
|
|
|
|
// instance.addBuildings(BuildingType.Normal, 1);
|
|
|
|
|
// }
|
|
|
|
|
// instance.addBuildings(BuildingType.Environment, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
|
|
|
|
|
instance.addBuildings(BuildingType.Normal, 0, (uiItem, index) => { |
|
|
|
|
if (index == 0 && uiItem.buildingInfo.isEnable) { |
|
|
|
|
instance.onChangeCurrentBuildingItem(uiItem, false); |
|
|
|
|
//uiItem.lookAt(false);
|
|
|
|
|
// console.log("默认选中" + uiItem.buildingInfo.buildingData.normalData.key);
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// instance.addBuildings(BuildingType.Normal, 0, (uiItem, index) => {
|
|
|
|
|
// if (index == 0 && uiItem.buildingInfo.isEnable) {
|
|
|
|
|
// instance.onChangeCurrentBuildingItem(uiItem, false);
|
|
|
|
|
// //uiItem.lookAt(false);
|
|
|
|
|
// // console.log("默认选中" + uiItem.buildingInfo.buildingData.normalData.key);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
instance.addBuildings(BuildingType.Environment, 0); |
|
|
|
|
} |
|
|
|
|
// instance.addBuildings(BuildingType.Environment, 0);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
instance.addBuildings(BuildingType.Normal, 0, (uiItem, index) => { |
|
|
|
|
if (index == 0 && uiItem.buildingInfo.isEnable) { |
|
|
|
|
instance.onChangeCurrentBuildingItem(uiItem, false); |
|
|
|
|
//uiItem.lookAt(false);
|
|
|
|
|
// console.log("默认选中" + uiItem.buildingInfo.buildingData.normalData.key);
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
instance.addBuildings(BuildingType.Environment, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1091,8 +1103,6 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存展示模块当前数据 |
|
|
|
|
*/ |
|
|
|
@ -1128,6 +1138,39 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
//#region 限制摄像机Y
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 摄像机Y高度的限制 |
|
|
|
|
*/ |
|
|
|
|
limitCameraY_min: number = null; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置相机target最小Y |
|
|
|
|
* @param value
|
|
|
|
|
*/ |
|
|
|
|
setLimitCameraY_min(value: number) { |
|
|
|
|
this.limitCameraY_min = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 限制摄像机Y |
|
|
|
|
*/ |
|
|
|
|
updateLimitCameraY() { |
|
|
|
|
if (SceneManager.Instance.defaultCamera != null) { |
|
|
|
|
if (this.limitCameraY_min != null) { |
|
|
|
|
if (SceneManager.Instance.defaultCamera.target.y < this.limitCameraY_min) { |
|
|
|
|
SceneManager.Instance.defaultCamera.target.y = this.limitCameraY_min; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|