libgdx - LibGDX:为 json 赋予新的价值
问题描述
我正在使用JsonReader
,JsonValue
如下所示:
JsonReader json = new JsonReader();
JsonValue jsonValue = json.parse(Gdx.files.internal("file.json"));
我的问题是如何添加新项目jsonValue
或更新值?
解决方案
我找到了解决方案:
jsonValue.remove("name");
jsonValue.addChild("name", new JsonValue("new Value"));
推荐阅读
- javascript - Redux - 调度动作(onClick 事件)
- karate - 空手道中的 Swtich 浏览器
- vue.js - Vue 将组件 1 中的数据传递给组件 2 中的方法
- flutter - 在将数据从 API 加载到 Flutter 中的 ListView 时加载微调器
- r - 如何根据值和积分该值的微积分结果填充新数据框?
- typescript - TypeScript 不推断特定类型
- javascript - onClick 不一致
- android - SQLite:消除后创建新项目时的 ID 错误
- salesforce-lightning - Salesforce - Aura 组件发布使用消息服务问题
- excel - Angular 5 - 如何使用 HTTPRespose.blob()?