unity3d LitJson 各种嵌套

本文深入探讨了游戏开发领域的核心技术,包括Unity3D、cocos2dX等游戏引擎的使用,以及OpenGL、OpenCV等图像处理技术在游戏开发中的应用。同时,还涉及了游戏程序、游戏美术和游戏策划等方面的知识。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

json文件:
{
"startMenu":[
   {
    "1":
      {
        "SenceInfo":{"Pos":"1,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
         "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      },
      "2":
      {
       
        "SenceInfo":{"Pos":"2,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      },
      "3":
      {
       
        "SenceInfo":{"Pos":"3,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
         "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      }
   }
 ],
 "mainMenu":[
   {
    "1":
      {
      
        "SenceInfo":{"Pos":"4,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      },
      "2":
      {
       
        "SenceInfo":{"Pos":"5,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
         "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      },
      "3":
      { 
        "SenceInfo":{"Pos":"6,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
        "Camera":{"Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          "FishInfo":[
         {"fishId":"1","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"2","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"},
          {"fishId":"3","fishName":"qwe","Pos":"0,0,0","Rotation":"0,0,0","Scale":"1,1,1"}]
      }
   }
 ]
}
     JsonData data=JsonMapper.ToObject(jsonData);   

        for(int i=0;i<data.Count;i++)
        {   
            for(int j=0;j<data[i].Count;j++)
            {
                for(int k=0;k<data[i][j].Count;k++)
                {
                    print(data[1][0][0]["SenceInfo"]["Pos"]);
                    JsonData dataInfo=data[i][j][k];
                }
            }
          }


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值