@@ -22,18 +22,18 @@ public class AudioClipWidget : UnityObjectWidget
22
22
static Coroutine CurrentlyPlayingCoroutine ;
23
23
static readonly string zeroLengthString = GetLengthString ( 0f ) ;
24
24
25
- public AudioClip RefAudioClip ;
26
- private string fullLengthText ;
25
+ public AudioClip audioClip ;
26
+ string fullLengthText ;
27
27
28
- private ButtonRef toggleButton ;
29
- private bool audioPlayerWanted ;
28
+ ButtonRef toggleButton ;
29
+ bool audioPlayerWanted ;
30
30
31
- private GameObject audioPlayerRoot ;
32
- private ButtonRef playStopButton ;
33
- private Text progressLabel ;
34
- private GameObject saveObjectRow ;
35
- private InputFieldRef savePathInput ;
36
- private GameObject cantSaveRow ;
31
+ GameObject audioPlayerRoot ;
32
+ ButtonRef playStopButton ;
33
+ Text progressLabel ;
34
+ GameObject saveObjectRow ;
35
+ InputFieldRef savePathInput ;
36
+ GameObject cantSaveRow ;
37
37
38
38
public override void OnBorrowed ( object target , Type targetType , ReflectionInspector inspector )
39
39
{
@@ -42,10 +42,10 @@ public override void OnBorrowed(object target, Type targetType, ReflectionInspec
42
42
this . audioPlayerRoot . transform . SetParent ( inspector . UIRoot . transform ) ;
43
43
this . audioPlayerRoot . transform . SetSiblingIndex ( inspector . UIRoot . transform . childCount - 2 ) ;
44
44
45
- RefAudioClip = target . TryCast < AudioClip > ( ) ;
46
- this . fullLengthText = GetLengthString ( RefAudioClip . length ) ;
45
+ audioClip = target . TryCast < AudioClip > ( ) ;
46
+ this . fullLengthText = GetLengthString ( audioClip . length ) ;
47
47
48
- if ( RefAudioClip . loadType == AudioClipLoadType . DecompressOnLoad )
48
+ if ( audioClip . loadType == AudioClipLoadType . DecompressOnLoad )
49
49
{
50
50
cantSaveRow . SetActive ( false ) ;
51
51
saveObjectRow . SetActive ( true ) ;
@@ -62,7 +62,7 @@ public override void OnBorrowed(object target, Type targetType, ReflectionInspec
62
62
63
63
public override void OnReturnToPool ( )
64
64
{
65
- RefAudioClip = null ;
65
+ audioClip = null ;
66
66
67
67
if ( audioPlayerWanted )
68
68
ToggleAudioWidget ( ) ;
@@ -95,7 +95,7 @@ private void ToggleAudioWidget()
95
95
96
96
void SetDefaultSavePath ( )
97
97
{
98
- string name = RefAudioClip . name ;
98
+ string name = audioClip . name ;
99
99
if ( string . IsNullOrEmpty ( name ) )
100
100
name = "untitled" ;
101
101
savePathInput . Text = Path . Combine ( ConfigManager . Default_Output_Path . Value , $ "{ name } .wav") ;
@@ -163,7 +163,7 @@ private IEnumerator PlayClipCoroutine()
163
163
{
164
164
playStopButton . ButtonText . text = "Stop Clip" ;
165
165
CurrentlyPlaying = this ;
166
- Source . clip = this . RefAudioClip ;
166
+ Source . clip = this . audioClip ;
167
167
Source . Play ( ) ;
168
168
169
169
while ( Source . isPlaying )
@@ -191,7 +191,7 @@ private void StopClip()
191
191
192
192
public void OnSaveClipClicked ( )
193
193
{
194
- if ( ! RefAudioClip )
194
+ if ( ! audioClip )
195
195
{
196
196
ExplorerCore . LogWarning ( "AudioClip is null, maybe it was destroyed?" ) ;
197
197
return ;
@@ -212,7 +212,7 @@ public void OnSaveClipClicked()
212
212
if ( File . Exists ( path ) )
213
213
File . Delete ( path ) ;
214
214
215
- SavWav . Save ( RefAudioClip , path ) ;
215
+ SavWav . Save ( audioClip , path ) ;
216
216
}
217
217
218
218
public override GameObject CreateContent ( GameObject uiRoot )
0 commit comments