public void smellDissipate() { //只更新要更新的floorSmell for (int y = 0; y < maxFloorLength; y++) { for (int x = 0; x < maxFloorLength; x++) { floorSmell curFloorSmell = floorDatas[x, y].floorSmell; if (curFloorSmell.attackSmell.smell > 0) { curFloorSmell.attackSmell.smell -= globalVarManager.deltaTime; } if (curFloorSmell.enemySmell.smell > 0) { curFloorSmell.enemySmell.smell -= globalVarManager.deltaTime; } if (curFloorSmell.friendlySmell.smell > 0) { curFloorSmell.friendlySmell.smell -= globalVarManager.deltaTime; } if (curFloorSmell.mineSmell.smell > 0) { curFloorSmell.mineSmell.smell -= globalVarManager.deltaTime; } floorDatas[x, y].floorSmell = curFloorSmell; } } }
public void smellDissipate() { int minX = 1; int maxX = 20; int minY = -7; int maxY = 6; //只更新要更新的floorSmell for (int y = minY + 50; y < maxY + 50; y++) { for (int x = minX + 50; x < maxX + 50; x++) { floorSmell curFloorSmell = floorDatas[x, y].floorSmell; if (curFloorSmell.attackSmell > 0) { curFloorSmell.attackSmell -= globalVarManager.deltaTime; } if (curFloorSmell.enemySmell > 0) { curFloorSmell.enemySmell -= globalVarManager.deltaTime; } if (curFloorSmell.friendlySmell > 0) { curFloorSmell.friendlySmell -= globalVarManager.deltaTime; } if (curFloorSmell.mineSmell > 0) { curFloorSmell.mineSmell -= globalVarManager.deltaTime; } floorDatas[x, y].floorSmell = curFloorSmell; } } }