会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
trap
thorough
首页
新随笔
联系
订阅
管理
2015年6月3日
Unity 异步网络方案 IOCP Socket + ThreadSafe Queue
摘要: Unity IOCP Socket + ThreadSafe Queue1.Socket.BeginReceive系列接口在unityweb下是不正常的,页面刷新会导致问题2.自己维护线程,会带来一点小麻烦3.下面采用iocp+threadsafequeue 来实现异步网络```public cla...
阅读全文
posted @ 2015-06-03 14:49 summernight
阅读(2132)
评论(1)
推荐(0)
2015年2月9日
unity 四元数, 两行等价的代码
摘要: Vector3 tmpvc;1. tmpvc = Quaternion.Euler (new Vector3 (0, 30, 0)) * new Vector3 (0, 0, 1);2. tmpvc = new Vector3 (sin (30.0f), 0, cos (30.0f)); ...
阅读全文
posted @ 2015-02-09 15:29 summernight
阅读(274)
评论(0)
推荐(0)
2015年1月31日
golang的项目结构 相关知识
摘要: ### 项目结构```├── bin│ ├── login│ └── main├── pkg│ └── darwin_amd64│ └── login│ └── auth1.a├── src│ ├── cfg│ │ └── testcfg.go│ ├── db│ │ ├── ...
阅读全文
posted @ 2015-01-31 16:48 summernight
阅读(437)
评论(0)
推荐(0)
2015年1月29日
stencil in unity3d
摘要: Pass { Stencil { Ref 1 Comp Always Pass REPLACE } AlphaTest Gr...
阅读全文
posted @ 2015-01-29 17:04 summernight
阅读(288)
评论(0)
推荐(0)
2015年1月26日
一段tcl代码
摘要: #!/usr/bin/wishproc icanspeak {} { set name [.ent get] if {[string length $name] != 0} { exec s $name }}label .lab -text "Enter word:"...
阅读全文
posted @ 2015-01-26 23:16 summernight
阅读(257)
评论(0)
推荐(0)
2015年1月21日
16_游戏编程模式ServiceLocator 服务定位
摘要: ####简单说,就是某个系统作为一个服务,对全局系统可见.Service Locator (服务定位)```//简单粗暴的代码, 使用声音系统// Use a static class?AudioSystem::playSound(VERY_LOUD_BANG);// Or maybe a sing...
阅读全文
posted @ 2015-01-21 15:09 summernight
阅读(343)
评论(0)
推荐(0)
15_游戏编程模式EventQueue
摘要: #### 两个例子1.GUI event loop```while (running){ // 从事件队列里获取一个事件 Event event = getNextEvent(); // Handle event...}```2.Central event bus 不同系统公用的通信中心...
阅读全文
posted @ 2015-01-21 13:31 summernight
阅读(346)
评论(0)
推荐(0)
2015年1月20日
14_ Component 游戏开发组件模式
摘要: # component不同作用的程序需要保持互相隔离我们不想ai 物理 渲染 声音 等等功能 耦合在一起,像下面这样```//bad if (collidingWithFloor() && (getRenderState() != INVISIBLE)){ playSound(HIT_FLOOR)...
阅读全文
posted @ 2015-01-20 18:17 summernight
阅读(259)
评论(0)
推荐(0)
11-13 游戏编程行为模式
摘要: ### Behavioral Pattern#### interpreter pattern string -> code instruction set: 提供基本操作virtual machine: 执行指令front-end: 生成效率更高的字节码```void setHe...
阅读全文
posted @ 2015-01-20 17:38 summernight
阅读(187)
评论(0)
推荐(0)
MonoBehavior lifecycle
摘要: awake 只调用一次, awake在所有obj都初始化之后被调用. 用途: 初始化游戏状态 设置脚本间的引用 ### ExecuteInEditMode 编辑模式下```这个模式下,脚本编译,会自动reload[ExecuteInEdit...
阅读全文
posted @ 2015-01-20 15:38 summernight
阅读(400)
评论(0)
推荐(0)
下一页