animationClip 通过脚本添加events无效

 animationClip.events.push({
            frame: time,
            func: 'shipUpdateDirection',
            params: [time.toString()],
        })
        animationClip.events.push({
            frame: time * 2,
            func: 'shipBack',
            params: [time.toString()],
        })

通过如上代码添加动画事件无效,在下方添加

animationClip.updateEventDatas();

就可以了
但是文档说这个方法3.1就废弃了,我用的3.6请问这个要怎么搞?

赋值.events,不要用.push,clip.events = []

是这样的,万分感谢。