unity3d物体移动脚本_Flash脚本-3D透视移动效果

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.使用直线工具创建网格:

1100_line1

Convert this to a graphic object.

将此转换为图形对象。

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

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

1100_line2

4.Create a line as shown below.

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

1100_line3

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.转到行动画片段的时间轴,并创建三个关键帧,如下所示。

1100_tool4

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.返回主时间轴,在现有图层上方创建两个图层,并按如下所示命名它们。

1100_tool5

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物体移动脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值