spec. timeline base functions complete
music volume changes should work now
This commit is contained in:
parent
42e98ac42d
commit
00a9437b06
|
@ -12611,8 +12611,8 @@ MonoBehaviour:
|
|||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 16.2
|
||||
m_fontSizeBase: 16.2
|
||||
m_fontSize: 14
|
||||
m_fontSizeBase: 14
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
|
@ -17728,7 +17728,7 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 0, b: 1, a: 1}
|
||||
m_Color: {r: 0.7058824, g: 0.59607846, b: 0.59607846, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
|
@ -20733,15 +20733,15 @@ MonoBehaviour:
|
|||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 16.2
|
||||
m_fontSizeBase: 16.2
|
||||
m_fontSize: 14
|
||||
m_fontSizeBase: 14
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 1024
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
|
@ -23966,7 +23966,7 @@ MonoBehaviour:
|
|||
m_TargetGraphic: {fileID: 1589389272}
|
||||
m_HandleRect: {fileID: 1589389271}
|
||||
m_Direction: 2
|
||||
m_Value: 0
|
||||
m_Value: 1
|
||||
m_Size: 1
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
|
@ -29668,7 +29668,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1126835991
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -30782,7 +30782,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 189.92252}
|
||||
m_AnchoredPosition: {x: 0, y: 129.84993}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!114 &1154875944
|
||||
|
@ -34270,7 +34270,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1287203020
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -34287,8 +34287,8 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0.03, y: -0.0000008866191}
|
||||
m_AnchoredPosition: {x: 0, y: 8.499998}
|
||||
m_SizeDelta: {x: 0.03, y: -17.000002}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1287203021
|
||||
MonoBehaviour:
|
||||
|
@ -36563,7 +36563,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -155.87057, y: 152.21938}
|
||||
m_AnchoredPosition: {x: -155.87057, y: 152.21939}
|
||||
m_SizeDelta: {x: 960, y: 403.53317}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1336470763
|
||||
|
@ -37768,8 +37768,10 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
ThemeTXT: {fileID: 4900000, guid: 2764bae4979406541a0596e739f420fd, type: 3}
|
||||
layer: {fileID: 1906769994}
|
||||
specialLayers: {fileID: 284286600}
|
||||
tempoLayer: {fileID: 1511927534}
|
||||
musicLayer: {fileID: 954835807}
|
||||
sectionLayer: {fileID: 1647324175}
|
||||
--- !u!1 &1426168092
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -38025,16 +38027,16 @@ RectTransform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1436123037}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 1, w: 0}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 380411594}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: -28}
|
||||
m_SizeDelta: {x: 0.15, y: 11.84}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!114 &1436123039
|
||||
|
@ -40542,7 +40544,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -42.494987}
|
||||
m_AnchoredPosition: {x: 0, y: -42.494995}
|
||||
m_SizeDelta: {x: 1440.022, y: -84.99}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1527251881
|
||||
|
@ -47065,7 +47067,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -84.990036}
|
||||
m_AnchoredPosition: {x: 0, y: -84.99002}
|
||||
m_SizeDelta: {x: 320, y: -84.99}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!1 &1852819572
|
||||
|
@ -52635,7 +52637,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -42.494987}
|
||||
m_AnchoredPosition: {x: 0, y: -42.494995}
|
||||
m_SizeDelta: {x: 1054, y: -84.99}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &2066632681
|
||||
|
|
|
@ -344,7 +344,7 @@ namespace HeavenStudio
|
|||
secPerBeat = 60f / songBpm;
|
||||
}
|
||||
|
||||
public void SetVolume(int percent)
|
||||
public void SetVolume(float percent)
|
||||
{
|
||||
musicSource.volume = percent / 100f;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ namespace HeavenStudio
|
|||
Coroutine currentGameSwitchIE;
|
||||
|
||||
[Header("Properties")]
|
||||
public int currentEvent, currentTempoEvent, currentPreEvent, currentPreSwitch;
|
||||
public int currentEvent, currentTempoEvent, currentVolumeEvent, currentSectionEvent,
|
||||
currentPreEvent, currentPreSwitch;
|
||||
public float startOffset;
|
||||
public bool playOnStart;
|
||||
public float startBeat;
|
||||
|
@ -220,8 +221,8 @@ namespace HeavenStudio
|
|||
return;
|
||||
|
||||
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
|
||||
List<float> tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList();
|
||||
|
||||
List<float> tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList();
|
||||
if (currentTempoEvent < Beatmap.tempoChanges.Count && currentTempoEvent >= 0)
|
||||
{
|
||||
// Debug.Log("Checking Tempo Change at " + tempoChanges[currentTempoEvent] + ", current beat " + Conductor.instance.songPositionInBeats);
|
||||
|
@ -234,6 +235,19 @@ namespace HeavenStudio
|
|||
}
|
||||
}
|
||||
|
||||
List<float> volumeChanges = Beatmap.volumeChanges.Select(c => c.beat).ToList();
|
||||
if (currentVolumeEvent < Beatmap.volumeChanges.Count && currentVolumeEvent >= 0)
|
||||
{
|
||||
// Debug.Log("Checking Tempo Change at " + tempoChanges[currentTempoEvent] + ", current beat " + Conductor.instance.songPositionInBeats);
|
||||
if (Conductor.instance.songPositionInBeats >= volumeChanges[currentVolumeEvent])
|
||||
{
|
||||
// Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + DynamicBeatmap.tempoChanges[currentTempoEvent].tempo);
|
||||
Conductor.instance.SetVolume(Beatmap.volumeChanges[currentVolumeEvent].volume);
|
||||
Conductor.instance.timeSinceLastTempoChange = Time.time;
|
||||
currentVolumeEvent++;
|
||||
}
|
||||
}
|
||||
|
||||
float seekTime = 8f;
|
||||
//seek ahead to preload games that have assetbundles
|
||||
SeekAheadAndPreload(Conductor.instance.songPositionInBeats, seekTime);
|
||||
|
@ -413,6 +427,21 @@ namespace HeavenStudio
|
|||
// Debug.Log("currentTempoEvent is now " + currentTempoEvent);
|
||||
}
|
||||
|
||||
if (Beatmap.volumeChanges.Count > 0)
|
||||
{
|
||||
currentVolumeEvent = 0;
|
||||
List<float> volumeChanges = Beatmap.volumeChanges.Select(c => c.beat).ToList();
|
||||
|
||||
for (int t = 0; t < volumeChanges.Count; t++)
|
||||
{
|
||||
if (volumeChanges[t] > beat)
|
||||
{
|
||||
break;
|
||||
}
|
||||
currentVolumeEvent = t;
|
||||
}
|
||||
}
|
||||
|
||||
SeekAheadAndPreload(beat);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,10 @@ namespace HeavenStudio.Editor
|
|||
|
||||
[Header("Components")]
|
||||
[SerializeField] private Image layer;
|
||||
[SerializeField] private Image specialLayers;
|
||||
[SerializeField] private Image tempoLayer;
|
||||
[SerializeField] private Image musicLayer;
|
||||
[SerializeField] private Image sectionLayer;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
@ -29,10 +31,13 @@ namespace HeavenStudio.Editor
|
|||
|
||||
private void Start()
|
||||
{
|
||||
specialLayers.GetComponent<Image>().color = theme.properties.SpecialLayersCol.Hex2RGB();
|
||||
tempoLayer.GetComponent<Image>().color = theme.properties.TempoLayerCol.Hex2RGB();
|
||||
musicLayer.GetComponent<Image>().color = theme.properties.MusicLayerCol.Hex2RGB();
|
||||
sectionLayer.GetComponent<Image>().color = theme.properties.SectionLayerCol.Hex2RGB();
|
||||
Tooltip.AddTooltip(tempoLayer.gameObject, $"Tempo Track");
|
||||
Tooltip.AddTooltip(musicLayer.gameObject, $"Music Volume Track");
|
||||
Tooltip.AddTooltip(sectionLayer.gameObject, $"Remix Sections Track");
|
||||
|
||||
|
||||
layer.gameObject.SetActive(false);
|
||||
|
|
|
@ -12,8 +12,10 @@ namespace HeavenStudio.Editor
|
|||
[Serializable]
|
||||
public class Properties
|
||||
{
|
||||
public string SpecialLayersCol;
|
||||
public string TempoLayerCol;
|
||||
public string MusicLayerCol;
|
||||
public string SectionLayerCol;
|
||||
|
||||
public string Layer1Col;
|
||||
public string Layer2Col;
|
||||
|
|
|
@ -21,10 +21,22 @@ namespace HeavenStudio.Editor.Track
|
|||
|
||||
public List<SpecialTimelineObj> specialTimelineObjs = new List<SpecialTimelineObj>();
|
||||
|
||||
[System.Flags]
|
||||
public enum HoveringTypes
|
||||
{
|
||||
TempoChange = 1,
|
||||
VolumeChange = 2,
|
||||
SectionChange = 4,
|
||||
}
|
||||
public static HoveringTypes hoveringTypes = 0;
|
||||
|
||||
private bool firstUpdate;
|
||||
|
||||
public static SpecialTimeline instance;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
instance = this;
|
||||
rectTransform = this.GetComponent<RectTransform>();
|
||||
|
||||
Setup();
|
||||
|
@ -50,6 +62,7 @@ namespace HeavenStudio.Editor.Track
|
|||
{
|
||||
if (!firstUpdate)
|
||||
{
|
||||
hoveringTypes = 0;
|
||||
firstUpdate = true;
|
||||
}
|
||||
|
||||
|
@ -65,15 +78,26 @@ namespace HeavenStudio.Editor.Track
|
|||
switch (Timeline.instance.timelineState.currentState)
|
||||
{
|
||||
case Timeline.CurrentTimelineState.State.TempoChange:
|
||||
AddTempoChange(true);
|
||||
if (!hoveringTypes.HasFlag(HoveringTypes.TempoChange))
|
||||
AddTempoChange(true);
|
||||
break;
|
||||
case Timeline.CurrentTimelineState.State.MusicVolume:
|
||||
AddVolumeChange(true);
|
||||
if (!hoveringTypes.HasFlag(HoveringTypes.VolumeChange))
|
||||
AddVolumeChange(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
hoveringTypes = 0;
|
||||
}
|
||||
|
||||
public void FixObjectsVisibility()
|
||||
{
|
||||
foreach (SpecialTimelineObj obj in specialTimelineObjs)
|
||||
{
|
||||
obj.SetVisibility(Timeline.instance.timelineState.currentState);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearSpecialTimeline()
|
||||
|
@ -125,9 +149,9 @@ namespace HeavenStudio.Editor.Track
|
|||
{
|
||||
GameObject volumeChange = Instantiate(RefVolumeChange.gameObject, this.transform);
|
||||
|
||||
volumeChange.transform.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
|
||||
volumeChange.transform.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
|
||||
volumeChange.transform.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
|
||||
volumeChange.transform.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB();
|
||||
volumeChange.transform.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB();
|
||||
volumeChange.transform.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB();
|
||||
|
||||
volumeChange.SetActive(true);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace HeavenStudio.Editor.Track
|
|||
rectTransform = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
protected void Update()
|
||||
{
|
||||
if (!Conductor.instance.NotStopped())
|
||||
{
|
||||
|
@ -98,5 +98,6 @@ namespace HeavenStudio.Editor.Track
|
|||
{
|
||||
return true;
|
||||
}
|
||||
public virtual void SetVisibility(Timeline.CurrentTimelineState.State state) {}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Editor.Track;
|
||||
|
||||
namespace HeavenStudio.Editor
|
||||
{
|
||||
|
@ -20,6 +21,7 @@ namespace HeavenStudio.Editor
|
|||
|
||||
public override void OnOpenTab()
|
||||
{
|
||||
SpecialTimeline.instance.FixObjectsVisibility();
|
||||
}
|
||||
|
||||
public override void OnCloseTab()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Editor.Track;
|
||||
|
||||
namespace HeavenStudio.Editor
|
||||
{
|
||||
|
@ -20,6 +21,7 @@ namespace HeavenStudio.Editor
|
|||
|
||||
public override void OnOpenTab()
|
||||
{
|
||||
SpecialTimeline.instance.FixObjectsVisibility();
|
||||
}
|
||||
|
||||
public override void OnCloseTab()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Editor.Track;
|
||||
|
||||
namespace HeavenStudio.Editor
|
||||
{
|
||||
|
@ -20,6 +21,7 @@ namespace HeavenStudio.Editor
|
|||
|
||||
public override void OnOpenTab()
|
||||
{
|
||||
SpecialTimeline.instance.FixObjectsVisibility();
|
||||
}
|
||||
|
||||
public override void OnCloseTab()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Editor.Track;
|
||||
|
||||
namespace HeavenStudio.Editor
|
||||
{
|
||||
|
@ -20,6 +21,7 @@ namespace HeavenStudio.Editor
|
|||
|
||||
public override void OnOpenTab()
|
||||
{
|
||||
SpecialTimeline.instance.FixObjectsVisibility();
|
||||
}
|
||||
|
||||
public override void OnCloseTab()
|
||||
|
|
|
@ -15,22 +15,27 @@ namespace HeavenStudio.Editor.Track
|
|||
|
||||
public DynamicBeatmap.TempoChange tempoChange;
|
||||
|
||||
private void Update()
|
||||
new private void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (hovering)
|
||||
{
|
||||
float newTempo = Input.mouseScrollDelta.y;
|
||||
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.TempoChange;
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange)
|
||||
{
|
||||
float newTempo = Input.mouseScrollDelta.y;
|
||||
|
||||
if (Input.GetKey(KeyCode.LeftShift))
|
||||
newTempo *= 5f;
|
||||
if (Input.GetKey(KeyCode.LeftControl))
|
||||
newTempo /= 100f;
|
||||
if (Input.GetKey(KeyCode.LeftShift))
|
||||
newTempo *= 5f;
|
||||
if (Input.GetKey(KeyCode.LeftControl))
|
||||
newTempo /= 100f;
|
||||
|
||||
tempoChange.tempo += newTempo;
|
||||
tempoChange.tempo += newTempo;
|
||||
|
||||
//make sure tempo is positive
|
||||
if (tempoChange.tempo < 1)
|
||||
tempoChange.tempo = 1;
|
||||
//make sure tempo is positive
|
||||
if (tempoChange.tempo < 1)
|
||||
tempoChange.tempo = 1;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateTempo();
|
||||
|
@ -47,10 +52,40 @@ namespace HeavenStudio.Editor.Track
|
|||
UpdateTempo();
|
||||
}
|
||||
|
||||
public override void OnLeftClick()
|
||||
{
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange)
|
||||
StartMove();
|
||||
}
|
||||
|
||||
public override void OnRightClick()
|
||||
{
|
||||
GameManager.instance.Beatmap.tempoChanges.Remove(tempoChange);
|
||||
DeleteObj();
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange)
|
||||
{
|
||||
GameManager.instance.Beatmap.tempoChanges.Remove(tempoChange);
|
||||
DeleteObj();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMove(float beat)
|
||||
{
|
||||
foreach (var tempoChange in GameManager.instance.Beatmap.tempoChanges)
|
||||
{
|
||||
if (this.tempoChange == tempoChange)
|
||||
continue;
|
||||
if (beat > tempoChange.beat - Timeline.instance.snapInterval && beat < tempoChange.beat + Timeline.instance.snapInterval)
|
||||
return false;
|
||||
}
|
||||
this.tempoChange.beat = beat;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SetVisibility(Timeline.CurrentTimelineState.State state)
|
||||
{
|
||||
if (state == Timeline.CurrentTimelineState.State.TempoChange || state == Timeline.CurrentTimelineState.State.Selection)
|
||||
gameObject.SetActive(true);
|
||||
else
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,21 +15,26 @@ namespace HeavenStudio.Editor.Track
|
|||
|
||||
public DynamicBeatmap.VolumeChange volumeChange;
|
||||
|
||||
private void Update()
|
||||
new private void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (hovering)
|
||||
{
|
||||
float newVolume = Input.mouseScrollDelta.y;
|
||||
SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.VolumeChange;
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume)
|
||||
{
|
||||
float newVolume = Input.mouseScrollDelta.y;
|
||||
|
||||
if (Input.GetKey(KeyCode.LeftShift))
|
||||
newVolume *= 5f;
|
||||
if (Input.GetKey(KeyCode.LeftControl))
|
||||
newVolume /= 100f;
|
||||
if (Input.GetKey(KeyCode.LeftShift))
|
||||
newVolume *= 5f;
|
||||
if (Input.GetKey(KeyCode.LeftControl))
|
||||
newVolume /= 100f;
|
||||
|
||||
volumeChange.volume += newVolume;
|
||||
volumeChange.volume += newVolume;
|
||||
|
||||
//make sure volume is positive
|
||||
volumeChange.volume = Mathf.Clamp(volumeChange.volume, 0, 100);
|
||||
//make sure volume is positive
|
||||
volumeChange.volume = Mathf.Clamp(volumeChange.volume, 0, 100);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateVolume();
|
||||
|
@ -45,10 +50,40 @@ namespace HeavenStudio.Editor.Track
|
|||
UpdateVolume();
|
||||
}
|
||||
|
||||
public override void OnLeftClick()
|
||||
{
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume)
|
||||
StartMove();
|
||||
}
|
||||
|
||||
public override void OnRightClick()
|
||||
{
|
||||
GameManager.instance.Beatmap.volumeChanges.Remove(volumeChange);
|
||||
DeleteObj();
|
||||
if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume)
|
||||
{
|
||||
GameManager.instance.Beatmap.volumeChanges.Remove(volumeChange);
|
||||
DeleteObj();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMove(float beat)
|
||||
{
|
||||
foreach (var volumeChange in GameManager.instance.Beatmap.volumeChanges)
|
||||
{
|
||||
if (this.volumeChange == volumeChange)
|
||||
continue;
|
||||
if (beat > volumeChange.beat - Timeline.instance.snapInterval && beat < volumeChange.beat + Timeline.instance.snapInterval)
|
||||
return false;
|
||||
}
|
||||
this.volumeChange.beat = beat;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SetVisibility(Timeline.CurrentTimelineState.State state)
|
||||
{
|
||||
if (state == Timeline.CurrentTimelineState.State.MusicVolume || state == Timeline.CurrentTimelineState.State.Selection)
|
||||
gameObject.SetActive(true);
|
||||
else
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,9 +5,11 @@
|
|||
"name": "Heaven Studio Default Editor Theme",
|
||||
|
||||
"properties": {
|
||||
"SpecialLayersCol": "f06d60",
|
||||
"TempoLayerCol": "6cbcc4",
|
||||
"MusicLayerCol": "a663cc",
|
||||
"SectionLayerCol": "ed9b2f",
|
||||
//A7F085
|
||||
|
||||
"Layer1Col": "ef476f",
|
||||
"Layer2Col": "f5813d",
|
||||
|
|
Loading…
Reference in a new issue