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/下载 ...
随机推荐
- HDU 4915 Parenthese sequence _(:зゝ∠)_ 哈哈
哦,我没做 #include <cstdio> #include <cstring> #include <algorithm> const int N = 1000 ...
- 【LeetCode】- Valid Palindrome(右回文)
[ 问题: ] Given a string, determine if it is a palindrome, considering only alphanumeric characters an ...
- gerrit git使用
有关git的參考资料 pro git中文版, 最好的git书籍 http://git-scm.com/book/zh 图解git http://marklodato.github.com/visual ...
- javascript中的“向量”
什么是向量 向量通常指一个有长度有方向的量.向量使所有的移动和空间行为更容易理解和在代码中实现.向量可以相加,缩放,旋转,指向某物体. 在javascript中,一个方向和长度(即向量)在二维空间中可 ...
- 3D-HEVC的TAppDecorder
一.点击项目右键设为启动项目. 二.配置文件 右键点击属性->点配置属性的Debugging,在command arguments一栏填上编码时生成的.bit文件和希望解码后文件的命名,在wor ...
- 第22题 Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given ...
- 揭秘上海传智播客平均工资超过7k
其中一位知情人士
大学毕业生人数破700万大关.如何破解"毕业即失业"中国式的大学困境? 2014年全国高校毕业生总数将达到727万人,比被称为"史上最难就业年"的2013年再添 ...
- Android Studio中导入Android项目StepbyStep
想把在eclipse的项目导入Android studio,有两种方法,但是我喜欢的是不改变项目文件结构的方法,因为这样可以兼容eclipse. 第一步: 导入的项目不能运行,需要配置运行环境.And ...
- html分析器——jericho-html-3.3分解table
原部分来自Internet上的其他博客,只是因为很长一段时间.忘了谁是参考,这里说声抱歉.. 先贴一些html页: <html> <head> <meta http-eq ...
- myeclipse解决JSP文件script调整背景颜色
1进口MyEclipse主题后,打开jsp要么html文件,jsvascript部分原因遭遇了一层白色的.闪避这个时候.症状,如下面: watermark/2/text/aHR0cDovL2Jsb2c ...