1
00:00:11,000 --> 00:00:12,866
你好，欢迎回来
hello and welcome back

2
00:00:13,566 --> 00:00:15,866
这堂课的目的是产生一个
the purpose of this lecture is to produce a

3
00:00:15,866 --> 00:00:17,566
落叶粒子效应
fallen leaves particle effect

4
00:00:17,900 --> 00:00:20,366
当橡树被砍倒的时候
when the oak tree is being chopped down

5
00:00:20,966 --> 00:00:22,766
所以我给你一个简单的演示
so I'll just give you a quick demo

6
00:00:22,766 --> 00:00:24,100
我们将要实现的目标
of what we're going to achieve

7
00:00:24,100 --> 00:00:25,066
在这次讲座中
in this lecture

8
00:00:25,500 --> 00:00:27,566
所以我就去玩了
so I'll just go and hit play

9
00:00:30,466 --> 00:00:32,233
我们就抓住脚趾
and we'll just grab the toes

10
00:00:34,366 --> 00:00:36,600
我们就在上面收集一个鸡蛋
and we'll just collect an egg on

11
00:00:37,700 --> 00:00:38,333
只是
and just

12
00:00:39,433 --> 00:00:40,833
在这里挖个洞
dig a hole here

13
00:00:42,466 --> 00:00:44,300
然后我们把蛋种在
and then we'll plant the egg on

14
00:00:45,500 --> 00:00:46,933
按g键
press the g key

15
00:00:47,800 --> 00:00:50,100
使橡树充分生长
to fully grow the oak tree

16
00:00:54,666 --> 00:00:56,600
按20次
to press it 20 times

17
00:00:57,600 --> 00:00:59,833
然后我们选择斧头
and then we'll select the axe

18
00:01:00,633 --> 00:01:01,700
然后我们会
and then we'll

19
00:01:02,133 --> 00:01:04,033
撞到树上，注意
hit the tree and notice the

20
00:01:04,800 --> 00:01:06,833
树叶的粒子效应
particle effect now of the leaves

21
00:01:06,833 --> 00:01:08,466
当我们砍树的时候
as we chop down the tree

22
00:01:10,266 --> 00:01:10,733
可以
okay

23
00:01:10,733 --> 00:01:13,700
这就是我们在这堂课要做的
so that's what we're going to be doing in this lecture

24
00:01:14,000 --> 00:01:15,966
所以我期待着在那里见到你
so I look forward to seeing you there

25
00:01:19,033 --> 00:01:20,833
你好，欢迎回来
hello and welcome back

26
00:01:21,533 --> 00:01:23,833
如介绍视频中所述
as mentioned in the introduction video

27
00:01:24,100 --> 00:01:26,433
这堂课的目的是
the purpose of this lecture is to produce

28
00:01:26,433 --> 00:01:28,700
落叶粒子效应
a fallen leaves particle effect

29
00:01:29,033 --> 00:01:31,433
当橡树被砍倒的时候
when the oak tree is being chopped down

30
00:01:32,333 --> 00:01:34,266
所以我们要从
so we're going to start off by

31
00:01:34,400 --> 00:01:37,733
为粒子效果创建游戏对象
creating a game object for that particle effect

32
00:01:38,366 --> 00:01:40,833
所以我们就导航到助理场景
so we'll just navigate to the assistant scene

33
00:01:41,700 --> 00:01:43,733
然后我们右键单击
and then we'll right click and then

34
00:01:44,100 --> 00:01:46,233
我们将创建一个空的游戏对象
we'll create an empty game object

35
00:01:48,300 --> 00:01:50,466
我们称之为游戏对象
and we'll call that game object

36
00:01:50,800 --> 00:01:52,933
落叶
deciduous leaves falling

37
00:01:53,533 --> 00:01:55,666
所以这是果汁
so this is juice

38
00:01:57,133 --> 00:01:58,133
树叶
leaves

39
00:01:59,066 --> 00:01:59,866
坠落
falling

40
00:02:03,833 --> 00:02:06,166
我们可以重新设置转换
and we can just reset that transform

41
00:02:08,033 --> 00:02:10,133
我把这个拖过去一点
I'll just drag this across a little bit

42
00:02:10,133 --> 00:02:11,633
只是为了让我们有更多的空间
just so we have a bit more room

43
00:02:13,866 --> 00:02:15,700
以及这个游戏对象
and to this game object

44
00:02:15,700 --> 00:02:18,733
我们要添加一个粒子系统组件
we're going to add a particle system component

45
00:02:18,933 --> 00:02:20,933
所以只要点击我们的组件
so just click on our components

46
00:02:21,466 --> 00:02:23,333
然后搜索粒子系统
then search for particle system

47
00:02:26,500 --> 00:02:29,833
现在我们要做的就是配置这个粒子
and now all we need to do is configure this particle

48
00:02:29,833 --> 00:02:32,766
表示落叶的系统
system to represent falling leaves

49
00:02:37,166 --> 00:02:39,266
所以我要做的第一件事就是
so the first thing I'm going to do is

50
00:02:39,266 --> 00:02:41,666
将“持续时间”更改为1.6
change the duration to 1.6

51
00:02:42,866 --> 00:02:47,566
我要将开始生存期设置为1.6
I'm going to set the start lifetime to 1.6

52
00:02:48,200 --> 00:02:50,066
然后是起动速度
and then the start speed

53
00:02:50,433 --> 00:02:52,633
至0.2
to 0.2

54
00:02:53,333 --> 00:02:56,033
我也要关掉循环
and I'm going to turn off looping as well

55
00:02:56,366 --> 00:02:57,966
所以我们就关掉循环
so we just turn off looping

56
00:02:59,533 --> 00:03:01,466
开始旋转
and the start rotation

57
00:03:01,900 --> 00:03:04,200
我要把它设为
I'm going to set that as a

58
00:03:04,600 --> 00:03:06,400
两个常数之间的随机数
random between two constants

59
00:03:06,400 --> 00:03:09,233
在北纬360度之间
that's going to be between north and 360

60
00:03:10,866 --> 00:03:13,500
然后我要加一个重力修正
and then I'm going to add a gravity modifier

61
00:03:13,500 --> 00:03:14,766
让树叶
so that the leaves give

62
00:03:14,833 --> 00:03:16,266
它们坠落的影响
the effect of their falling

63
00:03:16,266 --> 00:03:17,000
所以我要
so I'm going to

64
00:03:17,266 --> 00:03:19,066
设置为0 2
set that to 0 2

65
00:03:20,166 --> 00:03:22,966
模拟空间将是世界空间
and the simulation space is going to be world space

66
00:03:23,500 --> 00:03:24,733
所以这将是
so this is going to be

67
00:03:25,233 --> 00:03:26,366
发生在世界上
happening in the world

68
00:03:27,433 --> 00:03:29,600
而不是本地的游戏对象
rather than local to the game object

69
00:03:32,166 --> 00:03:32,700
和
and

70
00:03:33,666 --> 00:03:36,633
我要设置发射器的速度来变换
I'm going to set the emitter velocity to transform

71
00:03:36,633 --> 00:03:38,233
所以我们没有刚体
so we don't have a rigid body

72
00:03:38,600 --> 00:03:41,766
我要设置最大通过次数为5次
and I'm going to set the max pass calls to be just 5

73
00:03:42,200 --> 00:03:44,466
我们有五组叶子
so we'll have five groups of leaves

74
00:03:44,766 --> 00:03:46,100
会掉下去的
that are going to be falling

75
00:03:46,100 --> 00:03:47,700
作为粒子效应的一部分
as part of this particle effect

76
00:03:48,300 --> 00:03:50,400
接下来是排放
so moving on to the emission

77
00:03:52,266 --> 00:03:55,066
我们将设定一段时间内的利率仅为5%
we're going to set the rate over time to be just five

78
00:03:55,366 --> 00:03:57,000
因为我们要用五个粒子
because we're going to go five particles

79
00:03:57,600 --> 00:03:59,000
然后我们要引爆炸弹
and then we're going to set a burst

80
00:03:59,000 --> 00:04:00,000
我们将拥有所有
and we're going to have all

81
00:04:00,133 --> 00:04:01,700
五个粒子
five particles being

82
00:04:01,900 --> 00:04:03,800
在时间零点设置
sets at time zero

83
00:04:04,333 --> 00:04:06,100
所以他们马上就出发了
so they'll all kick off straight away

84
00:04:07,666 --> 00:04:09,233
所以这就是任务
so that's the mission

85
00:04:11,200 --> 00:04:15,166
对于形状，我们有一个球体
and then for the shape we're going to have a sphere

86
00:04:16,600 --> 00:04:18,966
球体而不是圆的原因是
and the reason for sphere and not circle is

87
00:04:18,966 --> 00:04:19,766
我们会有
we're gonna have

88
00:04:20,700 --> 00:04:22,266
也许你可以拥有这个球体
perhaps the sphere you can have things

89
00:04:23,300 --> 00:04:24,600
被踢开了
being sort of kicked off

90
00:04:24,766 --> 00:04:27,066
在一个圆的中间
in the middle of a circle in effect

91
00:04:27,600 --> 00:04:29,466
因为这是恐惧的一部分
because it's part way through this fear

92
00:04:30,600 --> 00:04:32,500
所以我们要把半径设为
so we're gonna set the radius to

93
00:04:33,333 --> 00:04:34,200
1.3
1.3

94
00:04:36,633 --> 00:04:40,166
我们要把半径厚度设为0.1
we're going to set the radius thickness to 0.1

95
00:04:43,266 --> 00:04:46,000
是的，让我点击这里的场景视图
so yeah let me just click on the scene view here

96
00:04:46,566 --> 00:04:49,100
所以我们可以随时点击播放看看我们有什么
so we can always click play to see what we have

97
00:04:50,266 --> 00:04:52,233
所以这就是我们目前的情况
so this is what we currently have

98
00:04:53,833 --> 00:04:57,333
它使用的只是一种标准
and it's using just the sort of standard

99
00:04:58,000 --> 00:05:00,100
此时模式粒子块
mode particle blocks at the moment

100
00:05:01,733 --> 00:05:05,866
所以下一件事就是在生命周期中设置颜色
so the next thing will set is the color over lifetime

101
00:05:06,200 --> 00:05:07,866
我们想让这些淡入淡出
and we want these fade in

102
00:05:08,600 --> 00:05:11,166
所以我们将选择切换生存期
so we'll select cut over lifetime

103
00:05:11,966 --> 00:05:14,833
然后在渐变编辑器中
and then in the gradient editor

104
00:05:15,333 --> 00:05:18,066
我们在这里再停一站
we'll set another stop to about here

105
00:05:18,166 --> 00:05:20,166
然后我们把这个设定为
and then we'll set this one to be

106
00:05:20,900 --> 00:05:23,366
透明的，所以我们会把它一直转下去
transparent so we'll turn that out for all the way down

107
00:05:25,066 --> 00:05:27,033
所以事情一开始是可见的
so things will start off visible

108
00:05:27,033 --> 00:05:29,500
到最后它们会逐渐消失
and then towards the end they'll gradually fade off

109
00:05:32,400 --> 00:05:34,833
所以我们将在整个生命周期内设置大小
so we'll set size over lifetime

110
00:05:35,400 --> 00:05:38,300
我们就用它的标准曲线
and we'll just use the standard curve that it's

111
00:05:38,800 --> 00:05:41,466
所有的标准直线
all the standard straight line that it sets up for that

112
00:05:44,333 --> 00:05:47,933
我们还将设置终生轮换
and we'll also set up rotation over lifetime as well

113
00:05:48,500 --> 00:05:49,400
我们要这些
and we'll have these

114
00:05:49,900 --> 00:05:51,466
粒子旋转
particles rotating

115
00:05:52,033 --> 00:05:53,900
最多180度
by up to 180 degrees

116
00:05:55,366 --> 00:05:58,266
接下来要做的就是设置一些噪音
and the next thing will do is set some noise

117
00:05:58,466 --> 00:06:00,700
给它们一点湍流
to give these a bit of turbulence

118
00:06:01,466 --> 00:06:04,333
我们将强度设为0.5
and we'll set the strength to 0.5

119
00:06:06,066 --> 00:06:09,833
质量将设置为中等2d
and the quality will set to medium 2d

120
00:06:10,900 --> 00:06:12,900
接下来我们要做的是
so the next thing we're going to do here is actually

121
00:06:12,900 --> 00:06:13,866
喝杯雪碧
have a sprite

122
00:06:14,200 --> 00:06:17,633
用来代替标准粒子
be used instead of the sort of standard particle

123
00:06:18,000 --> 00:06:19,866
所以我们要设置一个
so we're going to set a

124
00:06:20,366 --> 00:06:21,566
雪碧纹理
sprite texture

125
00:06:22,833 --> 00:06:25,966
所以我们把这个设为精灵
so we'll set this to sprites

126
00:06:26,900 --> 00:06:27,200
然后
and then

127
00:06:27,200 --> 00:06:29,233
我们需要设置要使用的精灵
we need to set the sprite that we're going to use

128
00:06:29,933 --> 00:06:31,933
如果我们点击这个选择器
so if we click on this selector

129
00:06:32,100 --> 00:06:33,666
我们要用雪碧
we're going to use a sprite

130
00:06:33,666 --> 00:06:35,966
叫峡谷橡树二号
called canyon oak underscore two

131
00:06:37,166 --> 00:06:39,766
所以如果我们寻找峡谷橡树，它就在这里
so if we search for canyon oak and here it is here

132
00:06:40,266 --> 00:06:42,766
基本上是一组三片叶子
it's basically a group of three leaves

133
00:06:44,066 --> 00:06:45,166
所以我们会选择它
so we'll select that

134
00:06:48,666 --> 00:06:49,800
所以这将使用
so that will use

135
00:06:50,333 --> 00:06:51,800
那些精灵
those sprites

136
00:06:52,233 --> 00:06:53,733
作为粒子
as the particles

137
00:06:54,466 --> 00:06:58,533
接下来我们需要做的是设置渲染器
the next thing we need to do is set up the renderer

138
00:06:59,433 --> 00:07:02,733
对于渲染器，我们需要设置材质
and for the renderer we need to set the material

139
00:07:02,833 --> 00:07:04,666
默认为精灵
to be sprites default

140
00:07:05,233 --> 00:07:08,133
所以我们在这里搜索精灵
so we just search here for sprites default

141
00:07:17,166 --> 00:07:17,733
和
and

142
00:07:18,133 --> 00:07:20,700
我们需要在渲染器中设置的其他内容
the other things that we need to set in the renderer

143
00:07:21,100 --> 00:07:23,500
是最小粒径
are the minimum particle size

144
00:07:24,400 --> 00:07:25,933
我们要把它设定为
and we're going to set that to be

145
00:07:26,533 --> 00:07:27,966
0.03
0.03

146
00:07:28,933 --> 00:07:33,766
我们要把最大粒径设为0.05
we're going to set the maximum particle size to be 0.05

147
00:07:35,266 --> 00:07:37,433
我们要设置排序层
and we're going to set the sorting layer

148
00:07:37,466 --> 00:07:38,966
成为实例
to be instances

149
00:07:40,066 --> 00:07:42,133
我们要把一层的顺序定为一层
and we're going to set the order in layer to be one

150
00:07:42,233 --> 00:07:44,633
它似乎比其他东西更重要
as well so it appears over the top of other things

151
00:07:51,366 --> 00:07:53,500
现在你可以看到我们有一个
and now you can see we've got a

152
00:07:54,666 --> 00:07:56,466
这里的落叶效应
leaf falling effect here

153
00:07:57,133 --> 00:08:00,100
从这个球体的中心发射出来
being emitted from the center of this sphere here

154
00:08:00,633 --> 00:08:03,833
所以如果我们点击它你就可以看到
so if we click that you can just see we'd get a random

155
00:08:04,366 --> 00:08:05,566
叶片的产生
generation of leaves

156
00:08:05,566 --> 00:08:07,566
它们慢慢地飘落下来
and they sort of drifts gently down

157
00:08:07,566 --> 00:08:09,000
然后就消失了
and then just fade out

158
00:08:10,633 --> 00:08:12,100
目前看来不错
so that looks good so far

159
00:08:14,866 --> 00:08:17,233
这就是雪碧
so that's the sprite

160
00:08:17,800 --> 00:08:19,300
粒子效果设置
particle effect set up

161
00:08:19,633 --> 00:08:23,166
所以我们要为它创建一个预制件
so we're going to actually create a prefab for this

162
00:08:23,266 --> 00:08:27,033
所以，如果我们只是去资产，然后预制
so if we just go to assets and then prefabs

163
00:08:27,333 --> 00:08:28,633
然后收割
and then crop

164
00:08:29,500 --> 00:08:31,433
然后在“效果”文件夹中
and then in the effects folder

165
00:08:31,500 --> 00:08:34,233
我们已经有一个叫rein的预制房了
we've already got one prefab called rein

166
00:08:34,366 --> 00:08:35,400
为了特殊效果
for a special effect

167
00:08:35,733 --> 00:08:37,266
我要把这个拖过去
I'm just going to drag this one

168
00:08:37,300 --> 00:08:38,966
效果文件夹中
into that effects folder as well

169
00:08:40,400 --> 00:08:41,166
现在我们有了
now we've got it there

170
00:08:41,166 --> 00:08:43,000
我们可以把它从我们的场景中删除
we can delete it out of our scene

171
00:08:48,033 --> 00:08:49,966
所以接下来我们要做的就是
so the next thing we need to do is

172
00:08:50,400 --> 00:08:53,166
对裁剪脚本进行一些更改
make a few changes to the crop script

173
00:08:53,200 --> 00:08:56,333
所以让我们双击裁剪脚本
so let's just double click on the crop scripts

174
00:08:56,900 --> 00:08:58,866
在visualstudio中启动
to start that up in visual studio

175
00:08:59,066 --> 00:09:02,333
然后我们将要设置的裁剪脚本
and then for the crop script we're going to set up

176
00:09:02,933 --> 00:09:04,633
序列化字段
serialized field

177
00:09:04,900 --> 00:09:09,633
对于收割动作效果的变换位置
for a transform position for the harvest action effect

178
00:09:10,166 --> 00:09:12,033
将从触发
to be triggered from

179
00:09:12,633 --> 00:09:14,033
所以我只添加代码
so I'll just add the code

180
00:09:14,033 --> 00:09:15,400
你可以看看
and you can have a look at that

181
00:09:15,700 --> 00:09:17,066
所以我把它加在这里
so I'll just add it here

182
00:09:19,500 --> 00:09:22,166
所以我们有一个开始的工具提示
so we've just got a tool tip of a start

183
00:09:22,466 --> 00:09:25,566
这只是说这应该是从儿童开始的
and that just says this should be populated from child

184
00:09:25,566 --> 00:09:27,300
变换游戏对象
transform game objects

185
00:09:27,433 --> 00:09:29,966
显示收获效果产卵点
showing the harvest effect spawn point

186
00:09:31,166 --> 00:09:33,600
然后我们得到了一个
and then we just got a serialized field of

187
00:09:33,600 --> 00:09:34,866
类型转换
type transform

188
00:09:35,300 --> 00:09:38,733
我们称之为收获效应
and we've called that harvest action effect transform

189
00:09:38,800 --> 00:09:39,833
所以这就是
so that's going to be

190
00:09:40,200 --> 00:09:44,266
收获效应发生的时间点
the point where the harvest effect will happen

191
00:09:44,766 --> 00:09:47,133
然后在这个过程中
and then in the process tall action

192
00:09:47,566 --> 00:09:50,066
下面我们要触发的方法
methods below we want to trigger

193
00:09:50,500 --> 00:09:52,233
这就是收获效应
that's harvest effects

194
00:09:53,000 --> 00:09:54,300
所以我们把它加在这里
so we'll add it here

195
00:09:54,366 --> 00:09:56,433
所以我添加了代码，然后讨论了一遍
so I add the code and then talk through it

196
00:09:58,133 --> 00:10:01,333
所以这是为了查看作物的细节
so what this does is it looks at the crop details

197
00:10:01,766 --> 00:10:06,500
看看他的收获行动效果是否属实
and looks to see if his harvest action effect is true

198
00:10:06,900 --> 00:10:09,800
如果是这样，如果我们有收获行动效应
and if it is so if we have a harvest action effect

199
00:10:10,200 --> 00:10:12,300
它所做的就是把这个叫做
then what it does is it calls this

200
00:10:12,766 --> 00:10:14,400
我们之前设置的事件
event that we set up before

201
00:10:15,033 --> 00:10:18,266
哪个是收获行动效果事件
which is the harvest action effect event

202
00:10:18,400 --> 00:10:19,900
我们在这个位置通过
and we pass in the position

203
00:10:19,900 --> 00:10:21,500
我们想要效果发生的地方
where we want the effect to happen

204
00:10:22,133 --> 00:10:24,900
然后我们把实际的
and then we pass in the actual

205
00:10:25,666 --> 00:10:27,333
我们想要的效果
effect that we want to

206
00:10:27,833 --> 00:10:31,866
运行和效果是在这里对作物的细节
run and the effect is here on the crop details

207
00:10:31,866 --> 00:10:33,733
所以那是个流浪汉
so that's an e bum

208
00:10:34,500 --> 00:10:35,166
所以
so

209
00:10:35,200 --> 00:10:39,100
对这棵树来说，这将是柑橘的落叶效应
for the tree it'll be the citrus leaves falling effect

210
00:10:40,766 --> 00:10:43,300
所以让我们保存那个裁剪脚本
so let's just save that crop script

211
00:10:43,566 --> 00:10:45,766
然后我们就回到团结
then we just head on back to unity

212
00:10:46,733 --> 00:10:49,366
现在我们要做的就是
and now what we're going to do is we're just going to

213
00:10:49,766 --> 00:10:51,633
对文件进行一些更改
make a few changes to the

214
00:10:53,266 --> 00:10:55,133
峡谷橡树预制
canyon oak prefab

215
00:10:55,766 --> 00:10:57,533
所以让我们双击它
so let's just double click on that

216
00:10:57,833 --> 00:11:01,433
我们将添加一个新的子游戏对象
and we're going to add a new child game object

217
00:11:01,633 --> 00:11:06,166
做一个庄稼精灵的孩子这样我们就可以创造空的
to be a child of crop sprites so we'll create empty

218
00:11:06,766 --> 00:11:10,366
这将是叶子的产卵点
and this is going to be the spawn point for the leaves

219
00:11:10,766 --> 00:11:13,566
所以我们称之为树叶繁殖点
so we'll call this leaves spawn point

220
00:11:16,466 --> 00:11:19,233
现在你可以看到它在基地
and at the moment you can see it's at the base

221
00:11:19,333 --> 00:11:21,833
我们希望它
of the tree and we want it to be about

222
00:11:22,133 --> 00:11:24,566
就在树的中央
sort of there in the center of the tree

223
00:11:24,800 --> 00:11:26,400
所以我们要设置y
so we're going to set the y

224
00:11:27,200 --> 00:11:29,633
变换到四的位置
position of the transform to four

225
00:11:31,066 --> 00:11:32,433
那只会移动它
and that will just move it

226
00:11:32,466 --> 00:11:34,233
你可能就在那里看到了
you probably just about see it there

227
00:11:34,600 --> 00:11:37,100
把它移到树的顶端
that moves it to the sort of top of the tree

228
00:11:37,266 --> 00:11:38,900
树的顶部中心
the top center of the tree

229
00:11:40,466 --> 00:11:42,833
好吧，这就是繁殖点
okay so that's the spawn point

230
00:11:43,366 --> 00:11:45,633
这样我们就可以离开了
so we can just back out of the

231
00:11:46,800 --> 00:11:49,466
峡谷橡树预制
canyon oak crop tree prefab

232
00:11:49,600 --> 00:11:50,233
然后事实上
and then actually

233
00:11:50,233 --> 00:11:52,566
我们还有一件事要做
there's one more thing that we need to set in the crop

234
00:11:52,566 --> 00:11:53,433
树木预制
tree prefab

235
00:11:53,433 --> 00:11:55,400
现在我们已经设置了繁殖点
so now we've set the spawn points

236
00:11:55,600 --> 00:11:57,200
如果我们去
if we go to the

237
00:11:57,733 --> 00:12:02,100
裁剪脚本所在的预置顶部
top of this prefab where the crop script is located

238
00:12:02,433 --> 00:12:05,433
然后我们需要填充刚刚创建的字段
then we need to populate the field that we just created

239
00:12:06,000 --> 00:12:07,033
哪个是
which is the

240
00:12:07,800 --> 00:12:09,900
收获动作效果转化
harvest action effect transform

241
00:12:10,033 --> 00:12:12,666
所以我们可以拖动最小的繁殖点
so we can literally just drag the least spawn point

242
00:12:13,566 --> 00:12:14,733
进入那个领域
into that field

243
00:12:15,533 --> 00:12:18,600
所以现在crop脚本引用了
so now the crop script has a reference to

244
00:12:18,833 --> 00:12:20,900
游戏对象的变换
the transform for that game object

245
00:12:21,533 --> 00:12:23,566
所以当它实际上是
so when it's actually the initiating

246
00:12:23,966 --> 00:12:25,666
落叶效应
the leaves falling effect

247
00:12:26,666 --> 00:12:29,433
所以现在就这样了，这样我们就可以把预制的东西放回去了
so that's done now so we can just back out that prefab

248
00:12:30,100 --> 00:12:32,466
我们可以控制s来保存场景
and we can control s to save the scene

249
00:12:33,366 --> 00:12:35,466
现在我们需要补充
and now we need to add

250
00:12:35,700 --> 00:12:38,433
对我们泳池经理的另一个影响
another effect to our pool manager

251
00:12:38,900 --> 00:12:42,400
所以我们只需点击池管理器游戏对象
so we'll just click on the pool manager game objects

252
00:12:42,633 --> 00:12:44,200
你可能还记得
you might remember before

253
00:12:44,533 --> 00:12:49,600
我们建立了一个10个收割预制池
we set up a pool of 10 reaping prefabs

254
00:12:50,366 --> 00:12:52,500
现在我们要建一个游泳池
and now we want to set up a pool

255
00:12:52,600 --> 00:12:54,800
为我们落叶飘落
for our deciduous leaves falling

256
00:12:54,800 --> 00:12:56,100
还有特效
special effects as well

257
00:12:56,566 --> 00:12:58,966
所以我们要增加游泳池的大小
so we're going to increase the pool size

258
00:12:59,733 --> 00:13:02,166
两个这样我们就可以再放一个预制板了
to two so we can put another prefab in

259
00:13:03,133 --> 00:13:07,200
至于柑橘叶，我们要五片
and then for the citrus leaves we're going to have five

260
00:13:07,400 --> 00:13:08,766
在游泳池里
of them in the pool

261
00:13:09,600 --> 00:13:12,566
我们可以把它拖进去
and we can just drag in the prefab

262
00:13:13,033 --> 00:13:14,100
到田野里去
into the field there

263
00:13:14,800 --> 00:13:15,966
所以我们现在有
so we've now got

264
00:13:16,433 --> 00:13:19,200
我们可怜的经理身上也有柑橘叶
citrus leaves as well in our poor manager

265
00:13:19,300 --> 00:13:20,666
所以我们可以访问这些
so we can access those

266
00:13:21,300 --> 00:13:23,133
从我们的视觉效果经理
from our visual effects manager

267
00:13:24,433 --> 00:13:27,200
下一个剧本是什么
which is the next script that we have to make

268
00:13:27,200 --> 00:13:28,633
有几个变化
a couple of changes to

269
00:13:29,500 --> 00:13:31,066
所以让我们双击
so let's just double click

270
00:13:31,733 --> 00:13:33,733
在我们的vfx管理器脚本上
on our vfx manager script

271
00:13:35,733 --> 00:13:37,600
我们要补充的第一件事
and the first thing we're going to add

272
00:13:37,600 --> 00:13:40,066
在我们的vfx管理器脚本中
in our vfx manager script is

273
00:13:40,366 --> 00:13:42,000
另一个序列化字段
another serialized field

274
00:13:42,200 --> 00:13:45,633
在落叶李的倒下预制参考
reference in the deciduous lee's fallen prefab

275
00:13:45,733 --> 00:13:47,566
所以我会在这之后再加上
so I'll add that after this

276
00:13:48,033 --> 00:13:49,400
我把它贴在这里
and I'll paste it in here

277
00:13:52,300 --> 00:13:55,633
所以它只是一个序列化字段类型的游戏对象
so it's just a serialized field type game objects

278
00:13:55,933 --> 00:13:58,900
这就是所谓的柑橘李倒下预制
and that's called the citrus lee's fallen prefab

279
00:13:59,333 --> 00:14:01,800
然后我们要把它填入督察室
and then we're going to populate that in the inspector

280
00:14:03,333 --> 00:14:05,333
所以我会省下来然后继续
so I'll just save and then carry on

281
00:14:05,766 --> 00:14:07,200
然后我们只需要向下滚动
then we just need to scroll down

282
00:14:07,266 --> 00:14:07,566
到
to

283
00:14:07,566 --> 00:14:10,533
显示收割动作效果的方法
the method where it displays the harvest action effect

284
00:14:11,033 --> 00:14:12,000
现在呢
and at the moment

285
00:14:12,233 --> 00:14:14,366
在我们测试的switch语句中
in this switch statement where we're testing

286
00:14:14,366 --> 00:14:16,566
应该发挥哪些收获作用
which harvest action effect should be played

287
00:14:16,833 --> 00:14:19,200
我们目前唯一真正测试的是
the only one we're really testing for at the moment is

288
00:14:19,200 --> 00:14:21,200
收获作用效应
the reaping harvest action effect

289
00:14:21,733 --> 00:14:24,866
所以我们需要在那里为
so we need to add another check in there for the

290
00:14:25,033 --> 00:14:26,700
落叶
deciduous leaves falling

291
00:14:26,900 --> 00:14:27,933
效果也一样
effect as well

292
00:14:28,500 --> 00:14:30,266
在这之前我们再加一句
so let's add that before here

293
00:14:31,000 --> 00:14:32,900
非常简单
so fairly straightforward

294
00:14:32,900 --> 00:14:35,166
我们只是在重复以前的做法
we're just duplicating what we did before

295
00:14:36,733 --> 00:14:38,833
而不是测试收获效果
instead of testing for the reaping effect

296
00:14:38,833 --> 00:14:42,000
我们正在测试落叶酒糟的下降效应
we're testing for the deciduous lees falling effects

297
00:14:42,966 --> 00:14:45,366
然后我们就用我们可怜的经理
and then we're just using our poor manager

298
00:14:45,700 --> 00:14:47,566
重用对象
to reuse the object

299
00:14:48,433 --> 00:14:50,833
为柑橘铅下降预制
for the citrus leads falling prefab

300
00:14:51,733 --> 00:14:54,166
我们在有效位置通过
and we pass in the effect position

301
00:14:54,766 --> 00:14:57,466
它被称为影响学校的一部分
it is called as part of the effect school

302
00:14:58,066 --> 00:15:00,833
旋转被设置为恒等式
and the rotation is just set to identity

303
00:15:01,666 --> 00:15:02,433
然后呢
and then it

304
00:15:02,600 --> 00:15:06,433
基本上就是将游戏对象设置为活动的
just basically sets the game object to be active

305
00:15:06,900 --> 00:15:10,166
然后在2秒后关闭
and then it disables it after 2 seconds

306
00:15:11,866 --> 00:15:13,566
所以我们可以把它保存下来
so we can just save that

307
00:15:15,033 --> 00:15:17,000
然后回到团结
and then return back to unity

308
00:15:17,800 --> 00:15:19,800
我们最后要做的就是
and the last thing we need to do is just

309
00:15:19,833 --> 00:15:22,466
加上落叶李的秋天的影响
add the deciduous lee's fall in effect

310
00:15:22,466 --> 00:15:23,766
预制到
prefab to the

311
00:15:24,033 --> 00:15:26,966
vfx管理器中的序列化字段
serialized field in the vfx manager

312
00:15:27,200 --> 00:15:28,266
我们刚加的
that we just added

313
00:15:28,800 --> 00:15:29,800
我也是
so is

314
00:15:30,033 --> 00:15:32,900
现在是空的，这样我们就可以把它拖进去
empty at the moment so we can just drag in that prefab

315
00:15:34,600 --> 00:15:35,466
就这样
just like that

316
00:15:36,233 --> 00:15:39,433
然后我们可以控制s来保存我们的持久场景
and then we can control s to save our persistent scene

317
00:15:40,600 --> 00:15:43,033
我们还可以重新设置课程布局
and we could reset our course layouts as well

318
00:15:44,333 --> 00:15:46,033
那应该是
and that should be

319
00:15:46,800 --> 00:15:49,133
我们需要做的所有改变
all of the changes that we need to make

320
00:15:49,300 --> 00:15:50,900
所以我们现在可以测试我们的游戏了
so we can test our game now

321
00:15:50,900 --> 00:15:53,000
所以我们去按play
so let's just go and press play

322
00:15:57,100 --> 00:15:59,433
在游戏中，让我们收集我们的工具
and in the game let's collect our tools

323
00:16:01,733 --> 00:16:04,000
我们去收集一些橡子
and we'll go and collect some acorns

324
00:16:04,433 --> 00:16:05,800
所以我们可以种植它们
so that we can plant them

325
00:16:09,066 --> 00:16:09,700
所以
so

326
00:16:11,233 --> 00:16:13,433
看起来不错，那我们就去拿大麻吧
that looks good so let's just get the ho

327
00:16:13,766 --> 00:16:15,166
找些理由
and take some grounds

328
00:16:21,433 --> 00:16:23,400
我们要种这些橡子
and we'll plant these acorns

329
00:16:28,666 --> 00:16:29,900
然后我们会按
and then we'll press the

330
00:16:29,966 --> 00:16:32,300
测试时间提前的g键
g key for the test time advance

331
00:16:33,366 --> 00:16:35,300
我们需要按20次
we'll need to press it 20 times

332
00:16:35,300 --> 00:16:36,733
直到我们得到一个完全成熟的
until we get a fully grown

333
00:16:37,066 --> 00:16:37,800
橡树
oak tree

334
00:16:44,566 --> 00:16:48,033
好了，现在就拿斧子来测试一下我们的能力
here we go so let's get the axe now and test out our

335
00:16:48,366 --> 00:16:49,766
落叶效应
leaves falling effects

336
00:16:52,133 --> 00:16:53,000
就这样
and there we go

337
00:16:53,500 --> 00:16:55,266
所以我觉得这看起来很有效
so I think that looks really effective

338
00:16:55,900 --> 00:16:58,500
所以打了七下之后，树就满了
so after seven strikes it should fill the tree

339
00:17:04,966 --> 00:17:05,766
树叶
the leaves

340
00:17:05,766 --> 00:17:08,133
它们被制造出来，然后逐渐消失
are produced and then they just gradually fade out

341
00:17:08,133 --> 00:17:09,066
它们会旋转
and they rotate

342
00:17:09,833 --> 00:17:12,033
所以这是一个很好的演示
so this is a really good demonstration of how

343
00:17:12,066 --> 00:17:13,233
特殊效果
particular effects

344
00:17:13,533 --> 00:17:15,833
非常简单的方法甚至可以非常有效
quite simple ones even can be very effective

345
00:17:20,933 --> 00:17:22,733
就这样很好
so that's it excellent

346
00:17:24,133 --> 00:17:27,600
好吧，让我们回到编辑那里
okay so let's just go back to the editor

347
00:17:29,466 --> 00:17:30,500
现在我们来控制
now we'll control

348
00:17:30,500 --> 00:17:31,366
我们得确认一下
s to make sure

349
00:17:31,366 --> 00:17:34,233
所有的东西都保存了，我们会瓦解等级制度
everything's saved and we'll collapse the hierarchy

350
00:17:34,233 --> 00:17:35,766
所以按住alt键
so hold the alt key down

351
00:17:36,400 --> 00:17:37,466
点击这里
click on there

352
00:17:38,400 --> 00:17:41,000
今天的讲座到此为止
and that's it for this lecture

353
00:17:41,000 --> 00:17:43,766
所以谢谢你的关注
so thank you for following along

354
00:17:44,133 --> 00:17:46,266
下次见
and I'll see you in the next one


