File tree 4 files changed +449
-4
lines changed
4 files changed +449
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
public class InnerAudio : Details
8
8
{
9
+ WXInnerAudioContext music ;
10
+ private void Start ( )
11
+ {
12
+ // 绑定额外的按钮操作
13
+ GameManager . Instance . detailsController . BindExtraButtonAction ( 0 , pause ) ;
14
+ GameManager . Instance . detailsController . BindExtraButtonAction ( 1 , stop ) ;
15
+ GameManager . Instance . detailsController . BindExtraButtonAction ( 2 , seek ) ;
16
+ }
17
+
9
18
protected override void TestAPI ( string [ ] args )
10
19
{
11
- var music = WX . CreateInnerAudioContext ( new InnerAudioContextParam ( ) {
20
+ music = WX . CreateInnerAudioContext ( new InnerAudioContextParam ( ) {
12
21
src = "https://res.wx.qq.com/wechatgame/product/webpack/userupload/20220901/211827/CallMeTeenTop.mp3" ,
13
22
needDownload = true //表示等下载完之后再播放,便于后续复用,无延迟
14
23
} ) ;
@@ -19,4 +28,34 @@ protected override void TestAPI(string[] args)
19
28
} ) ;
20
29
}
21
30
31
+
32
+ //暂停
33
+ public void pause ( )
34
+ {
35
+ Debug . Log ( "pause" ) ;
36
+ music . Pause ( ) ;
37
+ }
38
+
39
+ //停止
40
+ public void stop ( )
41
+ {
42
+ Debug . Log ( "stop" ) ;
43
+ music . Stop ( ) ;
44
+
45
+ }
46
+
47
+ //跳转
48
+ public void seek ( )
49
+ {
50
+
51
+ Debug . Log ( "seek" ) ;
52
+ music . Seek ( 3 ) ;
53
+ }
54
+
55
+ private void OnDestroy ( )
56
+ {
57
+ Debug . Log ( "音频示例 OnDestroy" ) ;
58
+ music . Stop ( ) ;
59
+ music . Destroy ( ) ;
60
+ }
22
61
}
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ MonoBehaviour:
18
18
entryDescription :
19
19
optionList : []
20
20
initialButtonText : " \u64AD\u653E\u97F3\u9891 "
21
- extraButtonList : []
21
+ extraButtonList :
22
+ - buttonText : " \u6682\u505C "
23
+ - buttonText : " \u505C\u6B62 "
24
+ - buttonText : " \u8DF3\u8F6C "
22
25
initialResultList : []
23
26
entryOrder : 0
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ MonoBehaviour:
16
16
categorySprite : {fileID: 21300000, guid: 10009e080ceca4d88b96fcdff0749dfc, type: 3}
17
17
entryList :
18
18
- {fileID: 11400000, guid: 1d998af43281d4eee9e1effc8f83bddd, type: 2}
19
+ - {fileID: 11400000, guid: fc3a7d7719412264b914d0ae6e094405, type: 2}
19
20
- {fileID: 11400000, guid: 1055cfc5cdda7407298fa2ff9997d0c6, type: 2}
20
21
- {fileID: 11400000, guid: 480646e3cd4d6a948a7538d483c1b043, type: 2}
21
22
- {fileID: 11400000, guid: ad04526c3748b4e2b8498f998dfea973, type: 2}
You can’t perform that action at this time.
0 commit comments