@cc-component/cc-core 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/core/home/AudioUtil.ts +2 -0
- package/index.ts +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Node, AudioSource, AudioClip, resources, director } from 'cc';
|
|
3
3
|
import { ResourceManager } from './ResourceManager';
|
|
4
4
|
import { BundleConfigName } from '../config/CommonEnum';
|
|
5
|
+
import { EDITOR } from 'cc/env';
|
|
5
6
|
/**
|
|
6
7
|
* @en
|
|
7
8
|
* this is a sington class for audio play, can be easily called from anywhere in you project.
|
|
@@ -15,6 +16,7 @@ export class AudioUtil {
|
|
|
15
16
|
private _audioSource2: AudioSource;
|
|
16
17
|
|
|
17
18
|
constructor() {
|
|
19
|
+
if (EDITOR) return;
|
|
18
20
|
//@en create a node as AudioUtil
|
|
19
21
|
//@zh 创建一个节点作为 AudioUtil
|
|
20
22
|
let AudioUtil = new Node();
|
package/index.ts
CHANGED