打包app執行轟炸超人發現遊戲開局就crash了....
43263-pqdof30pwk9.png
95688-6lpou38yl0i.png

在pc上複查發現這個錯誤
04236-o2zub6agc9j.png

最後發現是這邊出錯, int[,]在查詢數據時 address 不知道為什麼出錯了

for (int j = 0; j < map.MapConfig.ChunkH; j++){
    strm += "[";
    for (int i = 0; i < map.MapConfig.ChunkW; i++){
                //這邊出錯
        strm += matrixData[j, i] + ",";
    }
    strm += "],";
}
strm += "]";

詳細錯誤如下

IL_00af: call System.Int32& System.Int32[0...,0...]::Address(System.Int32,System.Int32)
at ETHotfix.AIPlayer.calcNonPath(System.Int32 depth) (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:366)
at ETHotfix.AIPlayer.calcPath() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:200)
at ETHotfix.AIPlayer.V_Think() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:86)
at ETHotfix.AIPlayer.think() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:79)
at ETHotfix.AILogic.UpdateLogic() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AILogic.cs:292)
at ETHotfix.BaseEntity.updateAILogicAct() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/Entity/BaseEntity.cs:1581)

代碼修改, 把查詢給int再使用就好了

for (int j = 0; j < map.MapConfig.ChunkH; j++){
    strm += "[";
    for (int i = 0; i < map.MapConfig.ChunkW; i++){
        num = matrixData[j, i];
        strm += num + ",";
    }           
    strm += "],";

以後有空再來查這個問題

标签: none

添加新评论