Skip to content

Commit

Permalink
Re-added trigger toggel to audio editor fix for #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
robhillman97 committed Oct 9, 2023
1 parent 18582ad commit eee9d49
Show file tree
Hide file tree
Showing 2 changed files with 354 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class IntHolder : ObjectHolder<int> { }
[SerializeField] private Toggle _toggleLoop;
[SerializeField] private Button _btnIncreaseRange;
[SerializeField] private Button _btnDecreaseRange;
[SerializeField] private Toggle _toggleTrigger;
[SerializeField] private GameObject _objJumpToStep;

[SerializeField] private TMP_Text _txtSliderRangeValue;
[SerializeField] private GameObject _panelRange;
Expand Down Expand Up @@ -101,6 +103,7 @@ public override void Initialization(Action<PopupBase> onClose, params object[] a
_btnIncreaseRange.onClick.AddListener(OnIncreaseRange);
_btnDecreaseRange.onClick.AddListener(OnDecreaseRange);
_btnRecordComplete.onClick.AddListener(OnClickRecordComplete);
_toggleTrigger.onValueChanged.AddListener(OnToggleTriggerValueChanged);

_sliderPlayer.minValue = 0;
_sliderPlayer.maxValue = 1f;
Expand Down Expand Up @@ -451,7 +454,15 @@ protected override void OnAccept()
_content.scale = 0.5f;
_content.url = $"http://{_fileName}";

_step.AddOrReplaceArlemTrigger(TriggerMode.Audio, ActionType.Audio, _content.poi, _audioClip.length, _inputTriggerStepNumber);
//_step.AddOrReplaceArlemTrigger(TriggerMode.Audio, ActionType.Audio, _content.poi, _audioClip.length, _inputTriggerStepNumber);
if (_toggleTrigger.isOn)
{
_step.AddOrReplaceArlemTrigger(TriggerMode.Audio, ActionType.Audio, _content.poi, _audioClip.length, _inputTriggerStepNumber);
}
else
{
_step.RemoveArlemTrigger(_content);
}

SaveLoadAudioUtilities.Save(filePath, _audioClip);

Expand All @@ -477,4 +488,9 @@ private void OnArrowButtonPressed()
_arrowUp.SetActive(false);
}
}

private void OnToggleTriggerValueChanged(bool value)
{
_objJumpToStep.SetActive(value);
}
}
Loading

0 comments on commit eee9d49

Please sign in to comment.