Browse Source

Fixed case typo in ControlAudio

master
Christopher 8 years ago
parent
commit
ef0dfaf987
  1. 4
      Assets/Fungus/Audio/Editor/ControlAudioEditor.cs
  2. 22
      Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs

4
Assets/Fungus/Audio/Editor/ControlAudioEditor.cs

@ -39,11 +39,11 @@ namespace Fungus
EditorGUILayout.PropertyField(controlProp);
EditorGUILayout.PropertyField(audioSourceProp);
string fadeLabel = "Fade Out Duration";
if (t.Control != ControlAudio.controlType.StopLoop && t.Control != ControlAudio.controlType.PauseLoop)
if (t.Control != ControlAudio.ControlType.StopLoop && t.Control != ControlAudio.ControlType.PauseLoop)
{
fadeLabel = "Fade In Duration";
string volumeLabel = "End Volume";
if (t.Control == ControlAudio.controlType.ChangeVolume)
if (t.Control == ControlAudio.ControlType.ChangeVolume)
{
fadeLabel = "Fade Duration";
volumeLabel = "New Volume";

22
Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs

@ -16,7 +16,7 @@ namespace Fungus
[ExecuteInEditMode]
public class ControlAudio : Command
{
public enum controlType
public enum ControlType
{
PlayOnce,
PlayLoop,
@ -26,8 +26,8 @@ namespace Fungus
}
[Tooltip("What to do to audio")]
[SerializeField] protected controlType control;
public virtual controlType Control { get { return control; } }
[SerializeField] protected ControlType control;
public virtual ControlType Control { get { return control; } }
[Tooltip("Audio clip to play")]
[SerializeField] protected AudioSourceData _audioSource;
@ -54,28 +54,28 @@ namespace Fungus
return;
}
if (control != controlType.ChangeVolume)
if (control != ControlType.ChangeVolume)
{
_audioSource.Value.volume = endVolume;
}
switch(control)
{
case controlType.PlayOnce:
case ControlType.PlayOnce:
StopAudioWithSameTag();
PlayOnce();
break;
case controlType.PlayLoop:
case ControlType.PlayLoop:
StopAudioWithSameTag();
PlayLoop();
break;
case controlType.PauseLoop:
case ControlType.PauseLoop:
PauseLoop();
break;
case controlType.StopLoop:
case ControlType.StopLoop:
StopLoop(_audioSource.Value);
break;
case controlType.ChangeVolume:
case ControlType.ChangeVolume:
ChangeVolume();
break;
}
@ -255,11 +255,11 @@ namespace Fungus
if (fadeDuration > 0)
{
fadeType = " Fade out";
if (control != controlType.StopLoop)
if (control != ControlType.StopLoop)
{
fadeType = " Fade in volume to " + endVolume;
}
if (control == controlType.ChangeVolume)
if (control == ControlType.ChangeVolume)
{
fadeType = " to " + endVolume;
}

Loading…
Cancel
Save