摘要: csv文件格式,在游戏开发主要用于本地配置文件使用,也就是策划配置表,配置 表中的数据是游戏逻辑数据的来源之一,另外一个数据来源于服务器,通过服务 器获取到验证数据,结合本地配置文件中的非验证数据,处理逻辑,或者UI显示 TextAsset binAsset = Resources.Load("ta 阅读全文
posted @ 2017-07-04 09:36 咸鱼翻身记 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 序列化数据: public static byte[] Serialize(IExtensible msg) { byte[] result; using (var stream = new MemoryStream()) { Serializer.Serialize(stream, msg); r 阅读全文
posted @ 2017-07-04 09:25 咸鱼翻身记 阅读(155) 评论(0) 推荐(0) 编辑
摘要: void Start () { //开启协程 StartCoroutine("dfhds"); } IEnumerator dfhds() { //for循环执行5次 for (int j = 0; j < 5; j++) { //等待两秒 yield return new WaitForSecon 阅读全文
posted @ 2017-05-11 10:45 咸鱼翻身记 阅读(841) 评论(0) 推荐(0) 编辑
摘要: float t; float t1; void Update () { if (Input.GetMouseButtonDown(0)) { t1 = Time.realtimeSinceStartup; if (t1 - t < 0.5f) { Debug.Log("双击"); } t = t1; 阅读全文
posted @ 2017-03-07 20:44 咸鱼翻身记 阅读(2254) 评论(0) 推荐(0) 编辑
摘要: 方法1: //创建一个数组,在界面那里把预制物体拖进FishPrefab里 public GameObject[] FishPrefab; //计时器 float timer = 0; void Update() { timer += Time.deltaTime; //三秒生成一个if (time 阅读全文
posted @ 2017-02-08 18:43 咸鱼翻身记 阅读(15892) 评论(0) 推荐(1) 编辑
摘要: float T=0; //时间间隔,在编辑面板可以调 public float interval=1; void Update(){ //每一帧所用的时间 T+=Time.deltaTime; if(T>=interval){ //计时器归零 T=0; } } 阅读全文
posted @ 2017-01-17 21:42 咸鱼翻身记 阅读(773) 评论(0) 推荐(0) 编辑
摘要: //前提是创建子弹预制体,把预制体拉进BulletPrefab里面 using UnityEngine;using System.Collections; public class game : MonoBehaviour { public GameObject BulletPrefab; // U 阅读全文
posted @ 2017-01-17 21:33 咸鱼翻身记 阅读(2958) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections; public class Cube : MonoBehaviour { Vector3 Caps; // Use this for initialization void Start () { //Caps = 阅读全文
posted @ 2017-01-17 21:18 咸鱼翻身记 阅读(4564) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections; public class CubeScript : MonoBehaviour { //脚本对象加载的时候调用 void Awake(){ Debug.Log ("Awake"); } //脚本可用的时候会被调用 阅读全文
posted @ 2017-01-17 20:26 咸鱼翻身记 阅读(152) 评论(0) 推荐(0) 编辑
摘要: //使用GameObject.Find()的方法找到物体并让物体旋转 Vector3 cube = GameObject.Find("Cube").transform.position; Transform cube1 = GameObject.Find("Cube").transform; cub 阅读全文
posted @ 2017-01-17 20:22 咸鱼翻身记 阅读(5607) 评论(0) 推荐(0) 编辑