代码控制人物选择角色
摘要:1 public GameObject[] characterPrefabs;//在外部赋值的角色 2 private GameObject[] characterGameObjects;//在代码中赋值的角色 3 private int selectIndex = 0; //当前选择的角色 4 private int length; //所有可供选择的角色...
阅读全文
posted @
2018-10-29 10:28
追求LPY
阅读(582)
推荐(0)
Unity自带的JsonUtility
摘要:1 [Serializable]//序列化 2 public class Person 3 { 4 public string name; 5 public int age; 6 } 7 8 [Serializable]//序列化 9 public class Persons 10 { 11 public Person[] persons; 12 } ...
阅读全文
posted @
2018-09-25 14:29
追求LPY
阅读(7590)
推荐(0)
Json自带的JsonData类库
摘要:void Start () { Fun2(); // Fun3(); } //第二种方案 用Json自带的JsonData类库 private void Fun2() { //{ 'Heros':[{'name':'超人','power':95},{'name':'蝙蝠侠','age...
阅读全文
posted @
2018-09-25 14:27
追求LPY
阅读(6605)
推荐(0)
Json写类
摘要:1 public class Hero 2 { 3 public string name; 4 public int power; 5 6 } 7 public class Heros 8 { 9 public Hero[] heros; 10 11 } 12 13 public class ListJsonDemo : MonoBehaviour...
阅读全文
posted @
2018-09-25 14:25
追求LPY
阅读(308)
推荐(0)
unity打开网页
摘要://打开网页 ID只有一个数字不同 传参 public void URLVideo(int ID) { string tempUrl = string.Format("https://www.bilibili.com/video/av1124944/?p={0}", ID); Application.OpenURL(tempUrl); ...
阅读全文
posted @
2018-09-19 11:14
追求LPY
阅读(4727)
推荐(0)
异步加载场景
摘要:1 //动态加载的图片 public Image LoadingImage; //动态加载的数字 public Text processText; //动态加载的时间 float timer; void Update() { if (timer ().fillAmount = timer; //Mathf.Fl...
阅读全文
posted @
2018-09-19 10:11
追求LPY
阅读(309)
推荐(0)