摘要: 一,一个接着一个显示字体;TypewriterEffect.cs属性:1,int CharsPerSecond,显示速度;2,string mText,字体内容; 阅读全文
posted @ 2013-03-29 14:00 韦斯利yx 阅读(561) 评论(0) 推荐(1) 编辑
摘要: 核心脚步:UIDraggablePanel.cs;UIDragPanelContents.cs细节:UIDraggablePanel脚步:1,关联滑动的GameObject;2,添加UIPanel.cs,并且和 “Panle”同级别;3,设置 DragEffect 和 滑动坐标:ScaleUIDragPanelContents脚步1,关联的GameObject加BoxCollider。2,DraggablePanel 参数:关联UIDraggablePanel.cs的GameObject3.UICenterOnChild,cs1,和UIDraggablePanel.cs关联在一起。实现滑动菜单 阅读全文
posted @ 2013-03-28 14:02 韦斯利yx 阅读(1084) 评论(0) 推荐(0) 编辑
摘要: 核心知识:WebCamTexture(网络摄像头材质)关键方法:WebCamTexture.Play()播放;WebCamTexture.Pause()暂停;WebCamTexture.Stop()停止;例1:public WebCamTexture webCamTexture;publicMaterial webCamMaterial;IEnumerator webCam(){yieldreturnApplication.RequestUserAuthorization(UserAuthorization.WebCam); if(Application.HasUserAuthoriza... 阅读全文
posted @ 2013-03-11 16:53 韦斯利yx 阅读(2341) 评论(0) 推荐(0) 编辑
摘要: 方案1:截屏保存,再显示。核心知识:1,Application.CaptureScreenshot("wuk.png");Unity会自动截屏保存在 Application.persistentDataPath+"/"+"wuk.png";2,WWW 网页;3,获取权限;<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permissionandroid:name="androi 阅读全文
posted @ 2013-03-11 16:52 韦斯利yx 阅读(3582) 评论(0) 推荐(0) 编辑
摘要: 核心知识: UIDragObject.cs 一,GameObject关联UIDragObject.cs;二,参数说明 Scale:每帧位置偏移量;Momentum Amount:快速滑动偏移量: DragEffect:滑动模式 阅读全文
posted @ 2013-03-11 16:43 韦斯利yx 阅读(1005) 评论(0) 推荐(0) 编辑
摘要: 当要使用如下方法时:碰撞GameObject和被碰撞GameObject,都必须得加 Rigidbody;Collider.OnTriggerEnter进入触发器Collider.OnCollisionEnter 进入碰撞 阅读全文
posted @ 2013-03-11 16:41 韦斯利yx 阅读(845) 评论(0) 推荐(0) 编辑
摘要: publicGameObject[] loadLevelBtS;publicstring[] loadLevelNameS;voidaddListener(){foreach(GameObjectgoinloadLevelBtS){UIEventListener.Get(go).onPress+=loadList;}}voidloadList(GameObjectgo,boolcanwith){intlistener=0;if(!canwith){if(listener==0){listener=1;intindex=int.Parse(go.name.Split('_')[1 阅读全文
posted @ 2013-03-11 16:39 韦斯利yx 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 玩游戏时,经常有这样的体验。我正常是左横屏,手机翻转过来为右横屏,游戏界面也随着翻转为右横屏。Unity3D引擎,不需要写任何代码,只需要 Player Setting 设置即可;如图所示: 阅读全文
posted @ 2013-09-12 10:45 韦斯利yx 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 有人问“更多游戏”没有网络权限怎么实现,其实调用浏览器访问外部链接不需要网络通讯权限,代码如下: Uri moreGame = Uri.parse("http://wapgame.189.cn/hd/yx?CAF=20110041"); startActivity(new Intent(Intent.ACTION_VIEW, moreGame)); 阅读全文
posted @ 2013-09-11 18:22 韦斯利yx 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 1,制作地图方式1:NGUI,新建一个Atlas,为M,按照一定的比例如1:400,绘制地图。新建一个GameObject,为A,关联UIPanel.A的transform.localScale为 0.25。A下,新建一个UISprite M。简单的地图就算Ok;2,导航地图两个关键点:位置与方向;// UI 中的角色publicTransform uitrans;// UI 中的角色,地图中对应publicTransform maptrans;void Update(){maptrans.rotation=uitrans.rotation;maptrans.localPosition=uit 阅读全文
posted @ 2013-09-11 11:43 韦斯利yx 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 在C#中,当我们想要存储一组对象的时候,就会想到用数组,ArrayList,List这三个对象了。那么这三者到底有什么样的区别呢?我们先来了解一下数组,因为数组在C#中是最早出现的。数组数组有很多的优点,比如说数组在内存中是连续存储的,所以它的索引速度是非常的快,而且赋值与修改元素也很简单,比如:string[]s=newstring[3];//赋值s[0]="a";s[1]="b";s[2]="c";//修改s[1]="b1";但是,数组也存在一些不足的地方。比如在数组的两个数据间插入数据也是很麻烦的。还有我们在 阅读全文
posted @ 2013-09-10 12:42 韦斯利yx 阅读(3287) 评论(1) 推荐(0) 编辑
摘要: 字符串操作:http://www.myexception.cn/mobile/455287.html1,判断两字符串是否相同NSString *str1 = @"hello pepe"; NSString *str2=[NSString stringWithFormat:@"hello %s","pepe"]; if([str1 isEqualToString:str2]){ NSLog(@"相同"); } else{ NSLog(@"不同"); }2,浮点型运算CGRect screenRec 阅读全文
posted @ 2013-09-10 11:19 韦斯利yx 阅读(316) 评论(0) 推荐(0) 编辑
摘要: CGRect screenRect=[UIScreenmainScreen].bounds;CGSize screenSize=screenRect.size;//屏幕分辨率screenSize.width;screenSize.height; 阅读全文
posted @ 2013-09-06 10:52 韦斯利yx 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 1,为了是更多机型能够安装你的游戏,Unity3d Device Filter设置:ARMv6 with VFP;2,华为C8600,一运行强制停止;参考网址:http://forum.unity3d.com/threads/120712-HTC-wildfire-Anything-I-can-do错误Log:09-02 17:12:46.657: E/Unity(8269): CPU features not supported! (no ARMv6+ / VFP)09-02 17:12:46.657: W/dalvikvm(8269): No implementation found fo 阅读全文
posted @ 2013-09-02 17:17 韦斯利yx 阅读(1620) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;using System.Net;using System.Net.Sockets;using System;using System.Text;public class ClientAsyncSocket : MonoBehaviour {/// /// Ayncs the connect socket./// /// /// The connect socket./// /// /// Server:""http://113.11.205.94"/// /// /// Por 阅读全文
posted @ 2013-08-26 13:28 韦斯利yx 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 服务器端源码:76号协议增加了加密字段sec-websocket-key1sec-websocket-key2以及最后8个字节服务器必须在握手信息之后发送回解密信息才能握手成功。解密方式key1 是sec-websocket-key1 后面所有字节key2 是sec-websocket-key2 后面所有字节part1 为 key1内除去所有的非数字字符后得到的数字 long型 / key1内空字符长度 int型part2为 key2内除去所有的非数字字符后得到的数字 long型 / key1内空字符长度 int型part1 转换为byte[] byte1 (例:byte1 = {1,2,3, 阅读全文
posted @ 2013-08-25 12:12 韦斯利yx 阅读(853) 评论(1) 推荐(0) 编辑
摘要: C# HttpJson,C#可用LitJsonC# LitJson文档网站http://lbv.github.io/litjson/docs/quickstart.html参考网站:http://www.json.org/http://lbv.github.io/litjson/一,Http请求 Request:Method空格Request-URI"空格"HTTP-Version"回车"Method表示对于Request-URI完成的方法,这个字段是大小写敏感的,包括OPTIONS、GET、HEAD、POST、PUT、DELETE、TRACE。方法GE 阅读全文
posted @ 2013-08-22 18:21 韦斯利yx 阅读(590) 评论(0) 推荐(0) 编辑