Skip to main content
ARShow
ARShow
 首页 » 资源教程 » Unity3D教程

Unity3D 零碎知识点集合 (持续更新)

2016年09月01日 12:38:5610150

1、拆分字符串
string strReceiveUDP = "0.1,0.2,0.3";
string[] arr = strReceiveUDP.Split(","[0]);
arr[0] = "0.1";
arr[1] = "0.2";

arr[2] = "0.3";


2、字符串转浮点型 string to float 
string str = "0.2";
float xx = float.Parse(str);


3、字符串与整型互转
e.gameObject.name=num.ToString();
num=int.Parse(e.gameObject.name);

评论列表暂无评论
发表评论