环境
系统:Windows 10
引擎:Unity 2017.2.1f1
目的
使用Animation和Canvas Group制作渐隐渐现的效果。
(1)首先把场景布局如此
(2)创建Animator Controller和Animation
(3)然后场景中的空对象root设置如下,加入Animator和Canvas Group。另外,为了之后的渐现动画,先把Alpha值设置为0。
(4)在Animator窗口加入刚创建Animation对象anim。
(5)先在Animation窗口选定Animation对象。然后再选场景对象root,可以激活Add Property按钮。激活后点击,弹出该场景对象及子对象的所有属性。因为要做渐隐渐现效果,所以选择Alpha属性。