问题
- 尝试访问类/类型的成员,并得到以下错误:
error CS0619: ________ is obsolete: `_________ is not supported any more. Use _______'
原因
当类成员被标记为Obsolete属性(当其不再被推荐使用时)时会发生这种情况,这样在引用类成员时将产生错误。
解决方案
- 例子:
error CS0619: `UnityEngine.GameObject.PlayAnimation(UnityEngine.Object)' is obsolete: `gameObject.PlayAnimation is not supported anymore. Use animation.Play()'
- 方法:
使用错误消息中推荐成员方法。
更多信息
https://msdn.microsoft.com/en-us/library/0f843030(v=vs.90).aspx