creator 音频播放的问题

我用的TS语法:
音频这样定义的:
@property(cc.AudioClip)
laba01: cc.AudioClip = null;
然后又这样的警告:
Please change the definition of property ‘shoot01’ in class ‘Main’. Starting from v1.10,
properties in CCClass can not be abbreviated if they are of type RawAsset.
Please use the complete form.
For example, if the type is Texture2D, the previous definition is:
shoot01: cc.Texture2D,
Now it should be changed to:
shoot01: {
type: cc.Texture2D // use ‘type:’ to define Texture2D object directly
default: null, // object’s default value is null
},
(This helps us to successfully refactor all RawAssets at v2.0, sorry for the inconvenience.
我按照警告定义,直接报错;

我是这么播放的:
cc.audioEngine.play(this.laba01,false,1)

然后警告:
Since 1.10, cc.audioEngine accept cc.AudioClip instance directly, not a URL string. Please directly reference the AudioClip object in your script, or load cc.AudioClip by loader first. Don’t use audio’s URL anymore

于是我看了源码:
static play(clip: AudioClip, loop: boolean, volume: number): number;
我是在不知道我按照规则使用怎么就警告了,关键声音比较多,播放一次警告一次,看得吐血!求老鸟解答一下。

@property({
type: cc.AudioClip
})
backMusic:cc.AudioClip = null;

1赞

好的!我刚从公司出来,明天一早试一下,头发都急掉了

感谢万分。
官方文档我看半天,愣是没看懂怎么写