unity3d手机游戏开发1,2,3,4,8,10章
笫
"丨
快速入门 ……¨ ……… …… ¨…… ……… ……¨ ¨¨¨ ……… ……¨ ¨……¨ …
】 ,l U△ ity简 介
12 运行 Un"
12】 Uiity的 版本
】 22 安装 Unlty
123 在线激活 U1iity
124 运 行 示例 工程
1.2.5 安装 Ⅴ 叔d stud⒗
创建一个
“
Hello WoHd” 程序
"l22224669
3 4
调试程序
】 4】 显 示 Log 1θ
【 o
ll
1,42 设 五断点 ¨¨¨…
小结
第 2扌
21
太空射击游戏 ¨ … … ¨ ¨ … … … … … … … … … ¨ … … … … … … … … … ¨ … … … …
浅谈游戏开发
2.1.l 开始
一个游戏项 目 ¨¨,
2,】 ,2 阶段性戍 采 ……¨…¨
2】 3 荥划
22223334
21" 编写脚本
2】 5 美术
2⒈ 6 QA浏 试
217 发布游戏
游戏策划
2.2,1 浒戏介绍 .…
14
】 4
14
14 2.2.2 游戏 UI
2.2.3 主 角
22.4 游戏操作
45
22.5 歃
导入美术资源
5 5
3 4
2 2
创建场景 16
u汀 0,抄 手机茁戏开拔 i
241 创建火星背景 …………………¨… ………… …¨…… 】 6
242 设呈摄像机和灯尢 ………… ¨ ¨ ¨ ¨ 20
2,5 创建主角 …¨……¨…………¨¨…¨………¨…………………¨……………¨ 21
25I 创建脚本 ………………………………………………………………………¨ 21
252 控制飞船移 动 …………………¨……… … … · · … … …23
2,5,3 创走亍弹 ………¨¨………… 25
254 创建子弹 Prcfab… ………………… …· ¨ · · ¨ ¨ ¨ 26
255 发射子弹 ~ ¨ ¨ ¨ 27
26 创建敌人 ……………………………………¨……¨…¨…
27 物理碰撞 ¨……¨……¨………………………… ¨ ¨ ¨ 30
¨ ¨ 28
271 添加碰拄体 ¨ 30
敌人 生成 器 , ……¨………………………41
游戏管理器
标题 界面 ¨ ¨ 48
发布游戏 ……¨ 49
… … … … … · · ¨ ¨ ¨ ¨ ¨ · · ¨ … · … ¨ · · … … … … ¨ ¨ 52
第-人 称 射 击游戏 ¨ … … … … … … … … … … … ¨ … … … … … … … … … … … … … 53
策划 ,… …¨……………¨………¨¨……………¨……¨……灬 ………………… 努
311 游戏介绍 …………………¨…………………………………………………… ⒔
272 触发碰拄 ………………………………… ¨ ¨.¨32
28 高级敌人 ,… …¨………………………………¨…………
28,l 创建敌人 ………………………¨…¨¨… ¨ ¨ ¨ 34
2.8,2 发射子弹 …………………………………………¨ ¨ 36
声 音与特效 …¨………………¨ 29
2】 o
21】
2,12
213
小结
第 3章
3】
312 U1界 面 ¨ ¨ …¨¨ ………… ¨ ¨ ¨ ¨ ¨53
31.3 主 角 … ¨…¨ …… …… ……
3⒈ 4 敌 人 ¨ … … … … … … … … … … … … … … … … …· … … ¨ ¨ ¨ ¨ 53
游戏场 景 ……………………………………………¨ ¨ . 53
主角 ……………………………………… ~54
331 角 色控 制器 …………………………………………………¨………………… 笕
3,3,2 玮 受 哨 扛 力 △ ¨ ¨ .¨ ¨ ¨ ¨
3,3,3 式器 ………………¨……………… ¨ ¨ ¨ ¨ 58
⒊ 4 敌人 …………………………………………¨¨
341 寻路 ………………………………………¨……………………………………”
342 设 置功 Ln。 … ¨… ……… …… …… … … … … … … … … 63
343 行 为 …… …… …… ……… …… …… ……… ……… …… ¨……
u界 面 ………………¨…¨………………………………………………………… “
2 3
3 3
5 6
3 3
交互 …………¨………………………………………… ¨ ¨ ¨ ¨ 72
, 0
361 =角 的射 击
3.62
OPenGL函数查询
Name
glAccum — operate on the accumulation buffer
C Specification
void glAccum(GLenum op, GLfloat value);
Parameters
op
Specifies the accumulation buffer operation. Symbolic constants GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted.
value
Specifies a floating-point value used in the accumulation buffer operation. op determines how value is used.
Description
The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices.
Each pixel in the accumulation buffer consists of red, green, blue, and alpha values. The number of bits per component in the accumulation buffer depends on the implementation. You can examine this number by calling glGetIntegerv four times, with arguments GL_ACCUM_RED_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS. Regardless of the number of bits per component, the range of values stored by each component is -1 1 . The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.
glAccum operates on the accumulation buffer. The first argument, op, is a symbolic constant that selects an accumulation buffer operation. The second argument, value, is a floating-point value to be used in that operation. Five operations are specified: GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN.
All accumulation buffer operations are limited to the area of the current scissor box and applied identically to the red, green, blue, and alpha components of each pixel. If a glAccum operation results in a value outside the range -1 1 , the contents of an accumulation buffer pixel component are undefined.
The operations are as follows:
GL_ACCUM
Obtains R, G, B, and A values from the buffer currently selected for reading (see glReadBuffer). Each component value is divided by 2 n - 1 , where n is the number of bits allocated to each color component in the currently selected buffer. The result is a floating-point value in the range 0 1 , which is multiplied by value and added to the corresponding pixel component in the accumulation buffer, thereby updating the accumulation buffer.
GL_LOAD
Similar to GL_ACCUM, except that the current value in the accumulation buffer is not used in the calculation of the new value. That is, the R, G, B, and A values from the currently selected buffer are divided by 2 n - 1 , multiplied by value, and then stored in the corresponding accumulation buffer cell, overwriting the current value.
GL_ADD
Adds value to each R, G, B, and A in the accumulation buffer.
GL_MULT
Multiplies each R, G, B, and A in the accumulation buffer by value and returns the scaled component to its corresponding accumulation buffer location.
GL_RETURN
Transfers accumulation buffer values to the color buffer or buffers currently selected for writing. Each R, G, B, and A component is multiplied by value, then multiplied by 2 n - 1 , clamped to the range 0 2 n - 1 , and stored in the corresponding display buffer cell. The only fragment operations that are applied to this transfer are pixel ownership, scissor, dithering, and color writemasks.
To clear the accumulation buffer, call glClearAccum with R, G, B, and A values to set it to, then call glClear with the accumulation buffer enabled.
Notes
Only pixels within the current scissor box are updated by a glAccum operation.
Errors
GL_INVALID_ENUM is generated if op is not an accepted value.
GL_INVALID_OPERATION is generated if there is no accumulation buffer.
GL_INVALID_OPERATION is generated if glAccum is executed between the execution of glBegin and the corresponding execution of glEnd.
Associated Gets
glGet with argument GL_ACCUM_RED_BITS
glGet with argument GL_ACCUM_GREEN_BITS
glGet with argument GL_ACCUM_BLUE_BITS
glGet with argument GL_ACCUM_ALPHA_BITS
See Also
glClear, glClearAccum, glCopyPixels, glDrawBuffer, glGet, glReadBuffer, glReadPixels, glScissor, glStencilOp
Copyright
Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com
经典C程序100例
经典C程序100例如
题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去掉不满足条件的排列。
程序源代码:
main()
{
int i,j,k;
printf("\n");
for(i=1;i<5;i++) /*以下为三重循环*/
for(j=1;j<5;j++)
for (k=1;k<5;k++)
{
if (i!=k&&i!=j&&j!=k) /*确保i、j、k三位互不相同*/
printf("%d,%d,%d\n",i,j,k);
}
}