Legacy Animation Can’t Animate Material Property

@(Bug记录)[UnityBug]

Legacy Animation Can’t Animate Material Property

问题描述

使用Animator可以控制材质的属性,但是Animator的初始化比较耗CPU,我们这里想继续使用Animation,但是Aniamtion自Unity 4.3之后就无法直接控制材质的属性了.

问题原因

Unity新版改变了Material 在 Aniamtion Clip 关键帧的格式,旧版Animation不支持.

The problem is that Unity has changed its Material keyframe formatting when it saves animation clips. If you need to use the legacy animation system here’s how to fix it:

Change animation type to 1

open the clip in a text editor, and replace classID 23 with classID 21

Still in the text editor, remove material. from the beginning of each Material attribute

Don’t know if this will fix the problem for everyone, but it worked wonders for me after banging my head against a wall for a while.

-Sterling Sr. Animator - Proletariat Inc.

解决方法

  1. Change this to “Force Text” [Edit->Project Settings->Editor] -> Asset Serialization
  2. 用文本编辑器打开生成的动画文件
  3. 将 ‘classID: 23’ 替换为’classID: 21’
  4. 将 ‘material.’ 替换为 ” (空串)
  5. 保存
  6. 在动画的Inspector面板上将Legacy选项勾上.

你可能感兴趣的:(unity,bug)