摘要: Unity IOCP Socket + ThreadSafe Queue1.Socket.BeginReceive系列接口在unityweb下是不正常的,页面刷新会导致问题2.自己维护线程,会带来一点小麻烦3.下面采用iocp+threadsafequeue 来实现异步网络```public cla... 阅读全文
posted @ 2015-06-03 14:49 summernight 阅读(2082) 评论(1) 推荐(0) 编辑
摘要: 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 阅读(265) 评论(0) 推荐(0) 编辑
摘要: ### 项目结构```├── bin│ ├── login│ └── main├── pkg│ └── darwin_amd64│ └── login│ └── auth1.a├── src│ ├── cfg│ │ └── testcfg.go│ ├── db│ │ ├── ... 阅读全文
posted @ 2015-01-31 16:48 summernight 阅读(423) 评论(0) 推荐(0) 编辑
摘要: Pass { Stencil { Ref 1 Comp Always Pass REPLACE } AlphaTest Gr... 阅读全文
posted @ 2015-01-29 17:04 summernight 阅读(280) 评论(0) 推荐(0) 编辑
摘要: #!/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 阅读(245) 评论(0) 推荐(0) 编辑
摘要: ####简单说,就是某个系统作为一个服务,对全局系统可见.Service Locator (服务定位)```//简单粗暴的代码, 使用声音系统// Use a static class?AudioSystem::playSound(VERY_LOUD_BANG);// Or maybe a sing... 阅读全文
posted @ 2015-01-21 15:09 summernight 阅读(327) 评论(0) 推荐(0) 编辑
摘要: #### 两个例子1.GUI event loop```while (running){ // 从事件队列里获取一个事件 Event event = getNextEvent(); // Handle event...}```2.Central event bus 不同系统公用的通信中心... 阅读全文
posted @ 2015-01-21 13:31 summernight 阅读(336) 评论(0) 推荐(0) 编辑
摘要: # component不同作用的程序需要保持互相隔离我们不想ai 物理 渲染 声音 等等功能 耦合在一起,像下面这样```//bad if (collidingWithFloor() && (getRenderState() != INVISIBLE)){ playSound(HIT_FLOOR)... 阅读全文
posted @ 2015-01-20 18:17 summernight 阅读(244) 评论(0) 推荐(0) 编辑
摘要: ### Behavioral Pattern#### interpreter pattern string -> code instruction set: 提供基本操作virtual machine: 执行指令front-end: 生成效率更高的字节码```void setHe... 阅读全文
posted @ 2015-01-20 17:38 summernight 阅读(179) 评论(0) 推荐(0) 编辑
摘要: awake 只调用一次, awake在所有obj都初始化之后被调用. 用途: 初始化游戏状态 设置脚本间的引用 ### ExecuteInEditMode 编辑模式下```这个模式下,脚本编译,会自动reload[ExecuteInEdit... 阅读全文
posted @ 2015-01-20 15:38 summernight 阅读(391) 评论(0) 推荐(0) 编辑