修复了一些问题

This commit is contained in:
COMPUTER\EDY 2026-01-16 11:11:19 +08:00
parent b88b6251de
commit 7993945c7e
6 changed files with 71 additions and 42 deletions

View File

@ -936,10 +936,14 @@ export default class Block extends cc.Component {
if (this.teamBlocks[i].uuid != this.node.uuid) {
this.teamBlocks[i].zIndex = 200;
for (let j = 1; j < this.teamBlocks[i].children.length; j++) {
if (this.teamBlocks[i].children[j].name != "moveFloor")
if (this.teamBlocks[i].children[j].name != "moveFloor") {
if (this.teamBlocks[i].children[j]) {
this.teamBlocks[i].children[j].active = false;
}
}
}
}
}
}
}
@ -997,12 +1001,14 @@ export default class Block extends cc.Component {
this.teamBlocks[i].getComponent("Block").blockFall(localTemp2, false);
for (let j = 1; j < this.teamBlocks[i].children.length; j++) {
if (this.teamBlocks[i].children[j].name != "moveFloor" && this.teamBlocks[i].children[j].name != "hit")
if (this.teamBlocks[i].children[j]) {
this.teamBlocks[i].children[j].active = true;
}
}
}
}
}
}
}
@ -1424,10 +1430,11 @@ export default class Block extends cc.Component {
}
if (type) {
for (let i = 0; i < this.node.children.length; i++) {
if (this.node.children[i].name == "left" || this.node.children[i].name == "right" || this.node.children[i].name == "top" || this.node.children[i].name == "down")
if (this.node.children[i].name == "left" || this.node.children[i].name == "right" || this.node.children[i].name == "top" || this.node.children[i].name == "down") {
this.node.children[i].active = true;
}
}
}
this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove, this);
this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEnd, this);
@ -1470,10 +1477,14 @@ export default class Block extends cc.Component {
if (this.block_Info.floor == null && this.block_Info.floorTime == null) return;
this.block_Info.floor = null;
this.block_Info.floorTime = null;
for (let i = 0; i < this.node.children.length; i++) {
this.moveFloorPd = null;
for (let i = this.node.children.length - 1; i >= 0; i--) {
if (this.node.children[i]) {
if (this.node.children[i].name == "floor" || this.node.children[i].name == "moveFloor") {
this.node.children[i].active = false;
// this.node.children[i].removeFromParent();
// this.node.children[i].destroy();
}
}
}
if (this.adhesiveNode.length > 0) {
@ -1481,20 +1492,28 @@ export default class Block extends cc.Component {
this.adhesiveNode[i].opacity = 255;
}
}
console.log("_____________删开始");
if (this.teamBlocks.length > 1) {
for (let j = 0; j < this.teamBlocks.length; j++) {
for (let k = 0; k < this.teamBlocks[j].children.length; k++) {
if (this.teamBlocks[j].children[k].active) {
if (this.teamBlocks[j].children[k].getComponent("lq_collide") != undefined) {
if (this.teamBlocks[j].children[k].getComponent("lq_collide").data_string == "-2") {
this.teamBlocks[j].children[k].active = false;
// if (this.teamBlocks[j].children[k].getComponent("lq_collide").data_string == "-2") {
// this.teamBlocks[j].children[k].active = false;
// // this.teamBlocks[j].children[k].destroy();
// }
// else if (this.teamBlocks[j].children[k].getComponent("lq_collide").data_string == "-1") {
// this.teamBlocks[j].children[k].active = true;
// }
}
}
}
}
}
this.teamBlocks = [];
}
}
}
debugger;
this.teamBlocks = [];
console.log("_____________删除完毕2");
this.node.getChildByName("icon").active = true;
if (this.type == BlockType.) {
if (this.node.getChildByName("freeze")) {
@ -1777,7 +1796,7 @@ export default class Block extends cc.Component {
const newY = this.node.y + delta.y;
const distance = Math.sqrt(Math.pow(newX - this.node.x, 2) + Math.pow(newY - this.node.y, 2));
let mag = Math.round(delta.mag());
console.log("移动距离", this.moveX, this.moveY);
// 脱离接触恢复可移动状态
if (this.moveY === 1) {
if (this.touchPointY <= this.node.y + this.node.height / 2) {
@ -2144,6 +2163,7 @@ export default class Block extends cc.Component {
}
setTeamBlocks(teamBlocks) {
// console.log("自己的類型::", this.block_Info.block, teamBlocks);
this.teamBlocks = teamBlocks;
}

View File

@ -3059,6 +3059,8 @@ export default class JiaZai extends cc.Component {
}
openPosition() {
if (this.RankNode == null || this.RankNode == undefined)
return;
let scrollVIew = this.RankNode.getChildByName("ScrollView");
let top = this.node.getChildByName("Load").getChildByName("Top");
// 获取CareerList组件实例
@ -3109,6 +3111,8 @@ export default class JiaZai extends cc.Component {
//授权位置信息
runAuthorize() {
if (this.RankNode == null || this.RankNode == undefined)
return;
let scrollVIew = this.RankNode.getChildByName("ScrollView");
let top = this.node.getChildByName("Load").getChildByName("Top");
// 获取CareerList组件实例
@ -3171,7 +3175,8 @@ export default class JiaZai extends cc.Component {
let top = this.node.getChildByName("Load").getChildByName("Top");
top.getChildByName("posBtn").active = true;
top.getChildByName("topBtn").active = false;
if (this.RankNode == null || this.RankNode == undefined)
return;
let scrollVIew = this.RankNode.getChildByName("ScrollView");
// 获取CareerList组件实例
let careerList = scrollVIew.getComponent("CareerList");

View File

@ -687,7 +687,7 @@ export default class MapConroler extends cc.Component {
let BLOCKS_PER_FRAME = 1; // 初始每帧创建的方块数量
const MAX_PER_FRAME = 10; // 每帧最大创建数量
const MIN_PER_FRAME = 1; // 每帧最小创建数量
let nianHe = false;
const createBlocks = () => {
const startTime = performance.now();
for (let i = 0; i < BLOCKS_PER_FRAME && index < blockArray.length; i++) {
@ -733,6 +733,7 @@ export default class MapConroler extends cc.Component {
this.blockNum += 1;
}
} else if (blockInfo.type == 9) {
nianHe = true;
if (blockInfo.adhesiveTime < 2) {
index++;
continue;
@ -783,7 +784,12 @@ export default class MapConroler extends cc.Component {
}, 0);
} else {
if (this.floorMove == true) {
let delayTime = 0;
if (nianHe == true)
delayTime = 200;
setTimeout(() => {
this.addMoveFloor();
}, delayTime);
}
}
};
@ -2106,11 +2112,15 @@ export default class MapConroler extends cc.Component {
for (let i = 0; i < floorBlock.length; i++) {
for (let j = 0; j < floorBlock[i].children.length; j++) {
if (floorBlock[i]) {
if (floorBlock[i].children[j]) {
if (floorBlock[i].children[j].name == "floor" || floorBlock[i].children[j].name == "moveFloor") {
floorBlock[i].children[j].getComponent("Floor").reduce(1);
}
}
}
}
}
let questionBlock = this.node.children.filter(child => {
if (child.getComponent("Block")) {

View File

@ -22,17 +22,7 @@ export default class CareerItem extends cc.Component {
/**数据改变时调用 */
public dataChanged() {
this.randerChildren = [];
// if (this.data == undefined) {
// this.node.active = false;
// return;
// }
// let useravatarIcon = this.data.useravatarIcon;
// useravatarIcon = "kuang_" + (parseInt(useravatarIcon) + 1);
// this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame =
// this.ui.getSpriteFrame(useravatarIcon);
// this.data.username = cc.fx.GameTool.subName(this.data.username, 7);
// let name = this.data.username;
// if (name == "user") name = "匿名玩家";
for (let i = 4; i < 12; i++) {
this.node.children[i].getChildByName("name").getComponent(cc.Label).string = "";
this.node.children[i].getChildByName("level").getComponent(cc.Label).string = "";

View File

@ -296,6 +296,7 @@ export default class CareerList extends cc.Component {
if (viewPos.y > bufferZone && item.y - offset - this.padding_buttom > -this.content.height - firstRenderOffsetY) {
if (item.getComponent(CareerItem)) {
let itemRender: CareerItem = item.getComponent(CareerItem);
if (items != null && items != undefined) {
let itemIndex = itemRender.itemIndex + items.length;
itemRender.itemIndex = itemIndex;
itemRender.data = this.itemDataList[itemIndex];
@ -304,6 +305,7 @@ export default class CareerList extends cc.Component {
}
}
}
}
} else {
if (viewPos) {
@ -311,6 +313,7 @@ export default class CareerList extends cc.Component {
if (viewPos.y < -bufferZone && item.y + offset + this.padding_top < -firstRenderOffsetY) {
if (item.getComponent(CareerItem)) {
let itemRender: CareerItem = item.getComponent(CareerItem);
if (items != null && items != undefined) {
let itemIndex = itemRender.itemIndex - items.length;
itemRender.itemIndex = itemIndex;
itemRender.data = this.itemDataList[itemIndex];
@ -321,6 +324,7 @@ export default class CareerList extends cc.Component {
}
}
}
}
this.lastContentPosY = this.scrollView.content.y;
}

View File

@ -167,7 +167,7 @@
{
"block": 1,
"color": 3,
"type": 9,
"type": 0,
"position": {
"x": 120,
"y": 240,
@ -182,7 +182,7 @@
{
"block": 1,
"color": 10,
"type": 9,
"type": 0,
"position": {
"x": 120,
"y": 120,