南瓜鬼脸 (Unity)

来源:互联网 发布:纪念碑谷mac版 编辑:程序博客网 时间:2024/05/15 10:48


这几天做了一个特别简单的案例,万圣节南瓜鬼脸。

        怎么说呢,我第一次接触Unity,给我的感觉还不错。从这个案例中我学到了很多东西。

         我要做一个总结

              万圣节鬼脸的建立:

                                     1:创建sprite。<也就是导入sprite>

                                     2:整理画面,调整镜头。

                                     3:让bat抖动,接着对所有的sprite加入淡入效果,最后就是流程控制。<自己也当了导演!>

              粒子系统

                       学会了材质的创建,加入,以及粒子各个功能的调整。

               代码:

                      Vector3<官网上找的>

                       Descriptation

                       Representation of 3D vectors and points.

                      This structure is used throughout Unity to pass 3D positions and directions around.It also contains functions for doing common vector operations.

                      Besides the functions listed below, other classes can be used to manipulate vectors and points as well.For example theQuaternion and the Matrix4x4 classes are useful  for rotating or transforming vectors and points.< x , y , z >.

                      var

                      var 是一种弱化类型的定义,定义了这个类型,编译器会自动判断该变量的类型。必须是这个形式var m = "asd" ,之后就无法给变量赋初始值类型不同的值了。这个变量是局部变量。

                      Time.deltaTime(The time in seconds it took to complete the last frame (Read Only).)<每一帧完成的秒数>

                       If you add or subtract to a value every frame chances are you should multiply with Time.deltaTime. When you multiply with Time.deltaTime you essentially express: I want to move this object 10 meters per second instead of 10 meters per frame.

                       GetComponent 我理解是获取内部的一个结构 ep.:GetComponent<spriteRanderer>获取sprite渲染器

                        transform:Every object in a scene has a Transform.It's used to store and manipulate the position, rotation and scale of the object

                         它被使用来储存和处理物体位置,旋转,物体的规模。ep.:var pos = transform.position;pos.x...............pos.y;

                       GameObject  :  Base class for all entities in Unity scenes.游戏里个体的基础集合。ep.:sp.SerActive(false);

                       Input.GetmouseButtonup(0),0代表鼠标左键。



1 0
原创粉丝点击