-
文档版本:
-
Version: 1.2
-
具体的问题或改进建议:
首先需要 在 PlayerController组件 中引用Body身上的 Animation。@property({type: Animation})
public BodyAnim: Animation = null;
此处的类型应该是AnimationComponent吧?
感谢您的反馈,目前该版本文档已不再进行维护,建议您使用新版本的引擎和文档。
https://docs.cocos.com/creator/manual/zh/getting-started/first-game/
@property({type: Animation})
public BodyAnim: Animation | null = null;
新版本文档此处也没有变
是否应该将类型声明Animation改为AnimationComponent?
但是声明为Animation会导致无法直接拖拽动画组件到脚本上
声明为AnimationComponent可以拖拽动画组件到脚本上,但是声明为Animation就不允许拖拽
你用的那个版本的Creator? 能发下测试工程吗?我发给技术看看
你看看顶部的import里有没有Animation,是不是导入错了
你参考下是否有有import
类似这样:
import { _decorator, Component, Node, Animation } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('PlayerController')
export class PlayerController extends Component {
@property(Animation)
animation:Animation;
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。


