P31RestKit.dll 2.0 Unity3d json
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using Prime31; public class JsonTest : MonoBehaviour
{
// Use this for initialization
void Start () {
Player player = new Player()
{
Name = "Lee",
Age = 19
}; string jsonString = Json.encode(player); Debug.Log(jsonString); player = Json.decode<Player>(jsonString); Debug.Log(player.Name);
Debug.Log(player.Age); List<Player> playerList = new List<Player>()
{
new Player() {Name = "wang", Age = 12},
new Player() {Name = "wang2", Age = 13},
new Player() {Name = "wang3", Age = 14},
new Player() {Name = "wang4", Age = 15},
new Player() {Name = "wang5", Age = 16},
}; string playerListString = Json.encode(playerList); Debug.Log(playerListString); List<Player> playerList2;
playerList2 = Json.decode<List<Player>>(playerListString); foreach (var p in playerList2)
{
Debug.Log(p.Name);
Debug.Log(p.Age);
}
} } public class Player
{
public string Name;
public int Age;
}
版权声明:本文博客原创文章。博客,未经同意,不得转载。
P31RestKit.dll 2.0 Unity3d json的更多相关文章
- Spring MVC 3.0 返回JSON数据的方法
Spring MVC 3.0 返回JSON数据的方法1. 直接 PrintWriter 输出2. 使用 JSP 视图3. 使用Spring内置的支持// Spring MVC 配置<bean c ...
- 基于MVC4+EF5.0+Ajax+Json+CSS3的简单注册页面(get&post)
使用mvc4可以很快速的创建页面,但封装的过多,难免会有些性能上的问题.所以基于此,通过使用简单的手写html,加ajax,json来创建一个注册页面,会比较干净,简洁. 本项目的环境是MVC4+EF ...
- .net core2.0添加json文件并转化成类注入控制器使用 让js调试更简单—console
.net core2.0添加json文件并转化成类注入控制器使用 上一篇,我们介绍了如何读取自定义的json文件,数据是读取出来了,只是处理的时候太麻烦,需要一遍一遍写,很枯燥.那么有没有很好的办法呢 ...
- ADO.NET .net core2.0添加json文件并转化成类注入控制器使用 简单了解 iTextSharp实现HTML to PDF ASP.NET MVC 中 Autofac依赖注入DI 控制反转IOC 了解一下 C# AutoMapper 了解一下
ADO.NET 一.ADO.NET概要 ADO.NET是.NET框架中的重要组件,主要用于完成C#应用程序访问数据库 二.ADO.NET的组成 ①System.Data → DataTable, ...
- Docker 导入镜像报错:open /var/lib/docker/tmp/docker-import-743441288/redis-3.0.7/json: no such file or directory
下载好了redis的tar包,然后导入redis镜像是报错open /var/lib/docker/tmp/docker-import-743441288/redis-3.0.7/json: no s ...
- asp.net core 3.0 MVC JSON 全局配置
asp.net core 3.0 MVC JSON 全局配置 System.Text.Json(default) startup配置代码如下: using System.Text.Encodings. ...
- 游戏开发设计模式之原型模式 & unity3d JSON的使用(unity3d 示例实现)
命令模式:游戏开发设计模式之命令模式(unity3d 示例实现) 对象池模式:游戏开发设计模式之对象池模式(unity3d 示例实现) 实现原型模式 原型模式带来的好处就是,想要构建生成任意独特对象的 ...
- ASP.NET2.0 Newtonsoft.Json 操作类分享
JSON 是现在比较流行的数据交互格式,NET3.0+有自带类处理JSON,2.0的话需要借助Newtonsoft.Json来完成,不然自己写的话,很麻烦. 网上搜索下载 Newtonsoft.Jso ...
- .net2.0 C# Json反序列化
http://cjl20082002.blog.163.com/blog/static/120827332009511103457637/ 去:http://json.codeplex.com/下载 ...
随机推荐
- 公钥\私人 ssh避password登陆
相关概念以前见过,决不要注意,使用公共密钥管理之前,腾讯云主机的备案机,非常头发的感觉,查了一下相关资料,这里总结下: 字符a:192.168.7.188 (ubuntu) 字符b:192.168.7 ...
- 简单的虚拟摇杆控制移动(NGUI)
一.用NGUI创建虚拟摇杆贴图 先创建一个sprite作为背景叫做JoyStick 并添加一个BoxCollider,再创建一个sprite child作为虚拟摇杆中间的按钮,叫做button 二.通 ...
- decimal ? 含义
例如: decimal ? je = zfje; 意思是 将 JE赋值为 ZFJE , 并且允许 JE 为 NULL 值 这时JE为引用类型
- LightOJ1010---Knights in Chessboard (规律题)
Given an m x n chessboard where you want to place chess knights. You have to find the number of maxi ...
- 【SEO 决胜网络索引】 课程大纲及第一部分第一课:网络营销战略中的索引
内容简介 1.课程大纲 2.第一部分第一课: 网络营销战略中的索引 3.第一部分第二课预告: 索引是什么 课程大纲 现在是网络为王的时代,人们越来越离不开互联网: SEO(Search Engine ...
- DOM手术台
CSS分类 排队: <div id="box" style="width:200px;border:1px solid red color:red;font-siz ...
- SQLSERVER中的log block校验(译)
原文:SQLSERVER中的log block校验(译) SQLSERVER中的log block校验(译) 来自:http://sankarreddy.com/2010/03/transaction ...
- 【Android基础】AndroidManifest常用权限permission整理
android.permission.ACCESS_COARSE_LOCATION 通过WiFi或移动基站的方式获取用户错略的经纬度信息,定位精度大概误差在30~1500米 android.permi ...
- Android ImageView分析并展开
版本号:1.0 日期:2014.6.11 2014.6.12 版权:© 2014 kince 转载注明出处 ImageView是开发中经常使用到的一个控件,也能够说是不可缺少的. 对于它的使用. ...
- SQL SERVER SQLOS的任务调度
原文:SQL SERVER SQLOS的任务调度 原文地址:http://blogs.msdn.com/b/apgcdsd/archive/2011/11/24/sql-server-sqlos.as ...