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选项勾上.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值