mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-05-02 03:54:27 +02:00

* move prefabs and music out of resources lower "real" audio cap update some packages * new game switch look audio optimizations * import SFB as package instead of plugin use updated SFB fork * fix game switch events * delete effect for game switch * new look for chart end * update Jukebox to 0.2.4 * fix outline ordering * re-isolated fan club sfx * move more stuff out of resources further reduce audiomanager virtual voices * fix rendering of other GameManager blocks
110 lines
3.2 KiB
C#
110 lines
3.2 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
using Jukebox;
|
|
using HeavenStudio.Util;
|
|
using TMPro;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HeavenStudio.Editor.Track
|
|
{
|
|
public class TimelineGameSwitch : TimelineEventObj
|
|
{
|
|
[SerializeField] RectTransform contentPanel;
|
|
[SerializeField] Image fadeEffect;
|
|
[SerializeField] Image leftLine;
|
|
[SerializeField] GameObject arrow;
|
|
|
|
new public void SetEntity(RiqEntity entity)
|
|
{
|
|
this.entity = entity;
|
|
}
|
|
|
|
new public void SetMarkerInfo()
|
|
{
|
|
base.SetMarkerInfo();
|
|
// SetColor(0);
|
|
}
|
|
|
|
new public void UpdateMarker()
|
|
{
|
|
base.UpdateMarker();
|
|
entity["track"] = 0;
|
|
entity.length = 0.5f;
|
|
// SetColor(0);
|
|
}
|
|
|
|
new public int GetTrack()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
new public void LateUpdate()
|
|
{
|
|
entity["track"] = 0;
|
|
entity.length = 0.5f;
|
|
rectTransform.anchoredPosition = new Vector2((float)entity.beat * Timeline.instance.PixelsPerBeat, -contentPanel.anchoredPosition.y);
|
|
SetWidthHeight();
|
|
}
|
|
|
|
new public void SetWidthHeight()
|
|
{
|
|
rectTransform.sizeDelta = new Vector2(entity.length * Timeline.instance.PixelsPerBeat, 0);
|
|
if (Icon.gameObject.activeSelf)
|
|
{
|
|
Icon.rectTransform.sizeDelta = new Vector2(24, 24);
|
|
eventLabel.rectTransform.offsetMin = new Vector2(Icon.rectTransform.anchoredPosition.x + Icon.rectTransform.sizeDelta.x + 4, eventLabel.rectTransform.offsetMin.y);
|
|
}
|
|
else
|
|
{
|
|
eventLabel.rectTransform.offsetMin = new Vector2(0, eventLabel.rectTransform.offsetMin.y);
|
|
}
|
|
}
|
|
|
|
public override void SetColor(int _)
|
|
{
|
|
Color c;
|
|
var eventName = entity.datamodel;
|
|
string[] split = eventName.Split('/');
|
|
if (split[0] == "gameManager")
|
|
{
|
|
if (split[1] == "switchGame")
|
|
{
|
|
c = StringUtils.Hex2RGB(EventCaller.instance.GetMinigame(split[2]).color);
|
|
foreach (var r in recolourables)
|
|
{
|
|
r.color = c;
|
|
}
|
|
|
|
c.a = 0.05f;
|
|
fadeEffect.color = c;
|
|
|
|
c.a = 0.15f;
|
|
leftLine.color = c;
|
|
|
|
arrow.SetActive(true);
|
|
}
|
|
else if (split[1] == "end")
|
|
{
|
|
c = Color.white;
|
|
foreach (var r in recolourables)
|
|
{
|
|
r.color = c;
|
|
}
|
|
leftLine.color = c;
|
|
|
|
c.a = 0.25f;
|
|
fadeEffect.color = c;
|
|
|
|
arrow.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool BoxSelectOverlapping(double startBeat, double endBeat, int startTrack, int endTrack)
|
|
{
|
|
return entity.beat.IsBetween(startBeat, endBeat) || (entity.beat + 0.25).IsBetween(startBeat, endBeat);
|
|
}
|
|
}
|
|
} |