unity3d物体移动脚本

tech2024-05-08  92

unity3d物体移动脚本

Many Flashers asked me how to create a 3d perspective effect, so here it is! Download the sample files here.

许多Flasher问我如何创建3D透视效果,就在这里! 在此处下载示例文件 。

1. Create a grid using the line tool:

1.使用直线工具创建网格:

Convert this to a graphic object.

将此转换为图形对象。

3. Make a duplicate of the graphic, and mirror it as shown below:

3.复制该图形,并将其镜像如下所示:

4.Create a line as shown below.

4.创建一条线,如下所示。

Convert this to a movie clip.

将此转换为影片剪辑。

5. Give this movie clip an instance name of line.

5.给该影片剪辑指定line的实例名称。

6. Go to the timeline of the line movieclip, and create three keyframes as shown below.

6.转到行动画片段的时间轴,并创建三个关键帧,如下所示。

7. In the first keyframe, insert the action:

7.在第一个关键帧中,插入操作:

y = /:initpos incr = 1;

8. In the second keyframe, insert:

8.在第二个关键帧中,插入:

setProperty ("", _y, y); y = y+incr; incr = incr + .2;

9. In the third keyframe, insert the action:

9.在第三个关键帧中,插入操作:

gotoAndPlay (2);

10.Go back to the main time line, create two layers above the existing layer, and name them as shown below.

10.返回主时间轴,在现有图层上方创建两个图层,并按如下所示命名它们。

Make sure that the line movieclip is in the line layer.

确保行动画片段在行图层中。

11.Select the 8th frame of all the layers, and press f5. This will extend the frame to the 8th.

11.选择所有图层的第8帧,然后按f5。 这会将帧扩展到第8位。

12. Go to the actions layer and in the first frame, insert the action:

12.转到动作层,然后在第一帧中插入动作:

initpos = getProperty("/line",_y); y = initpos; incr = 1; 18.In the second frame give action: duplicateMovieClip ( "/line","line" add incr, incr); incr = incr + 1; if((getProperty("/line" add incr,_y)) > 400) { removeMovieClip ("/line" add incr); }

13. In the last frame, inser the action:

13.在最后一帧中,插入动作:

gotoAndPlay (2);

翻译自: https://www.sitepoint.com/perspective-moving-effect/

unity3d物体移动脚本

相关资源:jdk-8u281-windows-x64.exe
最新回复(0)