随笔分类 -  Unity3D

摘要:1 //定义一个GUIStyle的对象 2 GUISytle labelFont = new GUIStyle(); 3 4 //设置文本颜色 5 labelFont.normal.textColor = new Color(1, 0, 0); 6 7 //设置字体大小 8 labelFont.fontSize = 10; 9 10 GUI.Label(new Rect(0, 0, 0, 0), "text", labelFont); 阅读全文
posted @ 2013-06-07 16:49 Clover-Z 阅读(1017) 评论(0) 推荐(0)
摘要:1 //首先通过Find函数找到场景中的平面 2 GameObject plane = GameObject.Find("Plane"); 3 4 //设定两个方向平铺次数 初始值是1 1 5 plane.renderer.material.mainTextureScale = new Vector2(x, y); 6 7 //设定两个方向的偏移 一般根据Time.time * Speed进行操作 8 plane.renderer.material.mainTextureOffset = new Vector2(Time.time * Speed, y); 阅读全文
posted @ 2013-06-07 16:44 Clover-Z 阅读(1382) 评论(0) 推荐(0)