put things in better places
oh this looks. so much fucking better. wow
This commit is contained in:
parent
649eafa035
commit
a0f3308bad
1863
Assets/Resources/Prefabs/Editor/WindowTemplate.prefab
Normal file
1863
Assets/Resources/Prefabs/Editor/WindowTemplate.prefab
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e66ea59167e0edc41ad445d9226040a7
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/Resources/Sprites/Editor/UI/icons/zoom-menu.png
Normal file
BIN
Assets/Resources/Sprites/Editor/UI/icons/zoom-menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
123
Assets/Resources/Sprites/Editor/UI/icons/zoom-menu.png.meta
Normal file
123
Assets/Resources/Sprites/Editor/UI/icons/zoom-menu.png.meta
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 93df82601dc3b8a4caf887fc1999707d
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMasterTextureLimit: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 0
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 0
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
cookieLightType: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable: {}
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load diff
|
@ -4,6 +4,7 @@ using BurstLinq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Jukebox;
|
using Jukebox;
|
||||||
|
using HeavenStudio.Games;
|
||||||
|
|
||||||
namespace HeavenStudio
|
namespace HeavenStudio
|
||||||
{
|
{
|
||||||
|
@ -23,11 +24,8 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public Minigames.Minigame GetMinigame(string gameName)
|
public Minigames.Minigame GetMinigame(string gameName)
|
||||||
{
|
{
|
||||||
if (!minigames.ContainsKey(gameName))
|
minigames.TryGetValue(gameName, out var minigame);
|
||||||
{
|
return minigame;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return minigames[gameName];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Minigames.GameAction GetGameAction(Minigames.Minigame game, string action)
|
public Minigames.GameAction GetGameAction(Minigames.Minigame game, string action)
|
||||||
|
@ -37,9 +35,9 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public Minigames.GameAction GetGameAction(string gameName, string action)
|
public Minigames.GameAction GetGameAction(string gameName, string action)
|
||||||
{
|
{
|
||||||
if (minigames.ContainsKey(gameName))
|
if (minigames.TryGetValue(gameName, out var minigame))
|
||||||
{
|
{
|
||||||
return minigames[gameName].actions.Find(c => c.actionName == action);
|
return minigame.actions.Find(c => c.actionName == action);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
public class Dialog : MonoBehaviour
|
public class Dialog : MonoBehaviour
|
||||||
{
|
{
|
||||||
public bool IsOpen { get { return dialog.activeSelf; } }
|
public bool IsOpen => dialog.activeSelf;
|
||||||
[SerializeField] protected GameObject dialog;
|
[SerializeField] protected GameObject dialog;
|
||||||
public void ForceState(bool onoff = false)
|
public void ForceState(bool onoff = false)
|
||||||
{
|
{
|
||||||
|
@ -26,5 +26,15 @@ namespace HeavenStudio.Editor
|
||||||
dialog.ForceState(false);
|
dialog.ForceState(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SwitchDialogue()
|
||||||
|
{
|
||||||
|
if (dialog.activeSelf) {
|
||||||
|
dialog.SetActive(false);
|
||||||
|
} else {
|
||||||
|
ResetAllDialogs();
|
||||||
|
dialog.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -81,7 +81,8 @@ namespace HeavenStudio.Editor
|
||||||
eventSelector.SetActive(true);
|
eventSelector.SetActive(true);
|
||||||
|
|
||||||
DestroyParams();
|
DestroyParams();
|
||||||
Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.displayName.Replace("\n", "")}");
|
// Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.displayName.Replace("\n", "")}");
|
||||||
|
Editor.instance?.SetGameEventTitle(gridGameSelector.SelectedMinigame.displayName.Replace("\n", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartParams(RiqEntity entity)
|
public void StartParams(RiqEntity entity)
|
||||||
|
|
|
@ -15,7 +15,7 @@ using System.Configuration;
|
||||||
|
|
||||||
namespace HeavenStudio.Editor
|
namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
// I hate the antichrist.
|
// I LOVE the antichrist!
|
||||||
public class GridGameSelector : MonoBehaviour
|
public class GridGameSelector : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Minigames.Minigame SelectedMinigame;
|
public Minigames.Minigame SelectedMinigame;
|
||||||
|
@ -34,6 +34,8 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
[Header("Properties")]
|
[Header("Properties")]
|
||||||
[SerializeField] private int currentEventIndex;
|
[SerializeField] private int currentEventIndex;
|
||||||
|
public Texture Square;
|
||||||
|
public Texture Circle;
|
||||||
public List<RectTransform> mgsActive = new List<RectTransform>();
|
public List<RectTransform> mgsActive = new List<RectTransform>();
|
||||||
public List<RectTransform> fxActive = new List<RectTransform>();
|
public List<RectTransform> fxActive = new List<RectTransform>();
|
||||||
public float posDif;
|
public float posDif;
|
||||||
|
@ -160,7 +162,8 @@ namespace HeavenStudio.Editor
|
||||||
currentEventIndex = index;
|
currentEventIndex = index;
|
||||||
UpdateIndex(index, false);
|
UpdateIndex(index, false);
|
||||||
|
|
||||||
Editor.instance?.SetGameEventTitle($"Select game event for {SelectedMinigame.displayName.Replace("\n", "")}");
|
// Editor.instance?.SetGameEventTitle($"Select game event for {SelectedMinigame.displayName.Replace("\n", "")}");
|
||||||
|
Editor.instance?.SetGameEventTitle(SelectedMinigame.displayName.Replace("\n", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddEvents(int index = 0)
|
private void AddEvents(int index = 0)
|
||||||
|
@ -186,7 +189,7 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
label.text = action.displayName;
|
label.text = action.displayName;
|
||||||
if (action.parameters != null && action.parameters.Count > 0)
|
if (action.parameters != null && action.parameters.Count > 0)
|
||||||
g.transform.GetChild(1).gameObject.SetActive(true);
|
g.transform.GetChild(0).GetChild(0).gameObject.SetActive(true);
|
||||||
|
|
||||||
if (index - 1 == i)
|
if (index - 1 == i)
|
||||||
label.color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
|
label.color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
|
||||||
|
@ -239,14 +242,16 @@ namespace HeavenStudio.Editor
|
||||||
if (!Input.GetKey(KeyCode.LeftControl)) return;
|
if (!Input.GetKey(KeyCode.LeftControl)) return;
|
||||||
var glg = GetComponent<GridLayoutGroup>();
|
var glg = GetComponent<GridLayoutGroup>();
|
||||||
var sizes = new List<float>() {
|
var sizes = new List<float>() {
|
||||||
209.5f,
|
309.9f, // 1
|
||||||
102.3f,
|
152.6f, // 2
|
||||||
66.6f,
|
100.0f, // 3
|
||||||
48.6f,
|
73.8f, // 4
|
||||||
37.9f,
|
58.1f, // 5
|
||||||
30.8f,
|
48.6f, // 6
|
||||||
25.7f,
|
40.1f, // 7
|
||||||
//21.9f,
|
34.5f, // 8
|
||||||
|
30.0f, // 9
|
||||||
|
26.5f, // 10
|
||||||
};
|
};
|
||||||
|
|
||||||
if (glg.constraintCount + 1 > sizes.Count && Input.GetAxisRaw("Mouse ScrollWheel") < 0) return;
|
if (glg.constraintCount + 1 > sizes.Count && Input.GetAxisRaw("Mouse ScrollWheel") < 0) return;
|
||||||
|
|
|
@ -18,10 +18,12 @@ namespace HeavenStudio.Editor
|
||||||
public Texture MaskTex;
|
public Texture MaskTex;
|
||||||
public Texture BgTex;
|
public Texture BgTex;
|
||||||
private Material m_Material;
|
private Material m_Material;
|
||||||
|
private Image image;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
Tooltip.AddTooltip(this.gameObject, EventCaller.instance.GetMinigame(this.gameObject.name).displayName);
|
// image = GetComponent<Image>();
|
||||||
|
Tooltip.AddTooltip(gameObject, EventCaller.instance.GetMinigame(gameObject.name).displayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
|
@ -33,8 +35,10 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
if (m_Material == null)
|
if (m_Material == null)
|
||||||
{
|
{
|
||||||
m_Material = Instantiate(GetComponent<Image>().material);
|
if (image == null) image = GetComponent<Image>();
|
||||||
GetComponent<Image>().material = m_Material;
|
|
||||||
|
m_Material = Instantiate(image.material);
|
||||||
|
image.material = m_Material;
|
||||||
}
|
}
|
||||||
m_Material.SetTexture("_MaskTex", MaskTex);
|
m_Material.SetTexture("_MaskTex", MaskTex);
|
||||||
m_Material.SetTexture("_BgTex", BgTex);
|
m_Material.SetTexture("_BgTex", BgTex);
|
||||||
|
@ -53,10 +57,8 @@ namespace HeavenStudio.Editor
|
||||||
if (Input.GetMouseButtonDown(1))
|
if (Input.GetMouseButtonDown(1))
|
||||||
{
|
{
|
||||||
// while holding shift and the game icon clicked has a star, it will disable all stars.
|
// while holding shift and the game icon clicked has a star, it will disable all stars.
|
||||||
if (Input.GetKey(KeyCode.LeftShift)) {
|
if (Input.GetKey(KeyCode.LeftShift) && StarActive) {
|
||||||
if (!StarActive) return;
|
for (int i = 0; i < transform.parent.childCount; i++) {
|
||||||
for (int i = 0; i < transform.parent.childCount; i++)
|
|
||||||
{
|
|
||||||
var ggsg = transform.parent.GetChild(i).GetComponent<GridGameSelectorGame>();
|
var ggsg = transform.parent.GetChild(i).GetComponent<GridGameSelectorGame>();
|
||||||
if (ggsg.StarActive) ggsg.Star();
|
if (ggsg.StarActive) ggsg.Star();
|
||||||
}
|
}
|
||||||
|
@ -76,14 +78,14 @@ namespace HeavenStudio.Editor
|
||||||
public void ClickIcon()
|
public void ClickIcon()
|
||||||
{
|
{
|
||||||
transform.DOScale(new Vector3(1.15f, 1.15f, 1f), 0.1f);
|
transform.DOScale(new Vector3(1.15f, 1.15f, 1f), 0.1f);
|
||||||
BgTex = Resources.Load<Texture>($"Sprites/GeneralPurpose/Circle");
|
BgTex = GridGameSelector.Circle;
|
||||||
SetupTextures();
|
SetupTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnClickIcon()
|
public void UnClickIcon()
|
||||||
{
|
{
|
||||||
transform.DOScale(new Vector3(1f, 1f, 1f), 0.1f);
|
transform.DOScale(new Vector3(1f, 1f, 1f), 0.1f);
|
||||||
BgTex = Resources.Load<Texture>($"Sprites/GeneralPurpose/Square");
|
BgTex = GridGameSelector.Square;
|
||||||
SetupTextures();
|
SetupTextures();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,10 @@ namespace HeavenStudio.Editor
|
||||||
public class SnapDialog : Dialog
|
public class SnapDialog : Dialog
|
||||||
{
|
{
|
||||||
[SerializeField] private TMP_Text snapText;
|
[SerializeField] private TMP_Text snapText;
|
||||||
|
[SerializeField] RectTransform rectTransform;
|
||||||
|
[SerializeField] RectTransform btnRectTransform;
|
||||||
|
[SerializeField] Vector2 spawnOffset;
|
||||||
|
|
||||||
private Timeline timeline;
|
private Timeline timeline;
|
||||||
|
|
||||||
private static float[] CommonDenominators = { 1, 2, 3, 4, 6, 8, 12, 16};
|
private static float[] CommonDenominators = { 1, 2, 3, 4, 6, 8, 12, 16};
|
||||||
|
@ -21,26 +25,22 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
public void SwitchSnapDialog()
|
public void SwitchSnapDialog()
|
||||||
{
|
{
|
||||||
if(dialog.activeSelf) {
|
if (dialog.activeSelf) {
|
||||||
dialog.SetActive(false);
|
dialog.SetActive(false);
|
||||||
} else {
|
} else {
|
||||||
ResetAllDialogs();
|
ResetAllDialogs();
|
||||||
|
var btnPos = btnRectTransform.position;
|
||||||
|
rectTransform.position = new Vector2(btnPos.x + spawnOffset.x, btnPos.y + spawnOffset.y);
|
||||||
dialog.SetActive(true);
|
dialog.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeCommon(bool down = false)
|
public void ChangeCommon(bool down = false)
|
||||||
{
|
{
|
||||||
if(down) {
|
if (currentCommon >= 0 && currentCommon < CommonDenominators.Length) {
|
||||||
currentCommon--;
|
currentCommon += down ? -1 : 1;
|
||||||
} else {
|
|
||||||
currentCommon++;
|
|
||||||
}
|
|
||||||
if(currentCommon < 0) {
|
|
||||||
currentCommon = 0;
|
|
||||||
} else if(currentCommon >= CommonDenominators.Length) {
|
|
||||||
currentCommon = CommonDenominators.Length - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
timeline.SetSnap(1f / CommonDenominators[currentCommon]);
|
timeline.SetSnap(1f / CommonDenominators[currentCommon]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,28 +110,28 @@ namespace HeavenStudio.Editor.Track
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
||||||
instance.SelectionsBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
// instance.SelectionsBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
if (tempoChange)
|
if (tempoChange)
|
||||||
{
|
{
|
||||||
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
||||||
instance.TempoChangeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
// instance.TempoChangeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
if (musicVolume)
|
if (musicVolume)
|
||||||
{
|
{
|
||||||
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
||||||
instance.MusicVolumeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
// instance.MusicVolumeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
if (chartSection)
|
if (chartSection)
|
||||||
{
|
{
|
||||||
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
||||||
instance.ChartSectionBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
// instance.ChartSectionBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
|
@ -179,7 +179,6 @@ namespace HeavenStudio.Editor.Track
|
||||||
public Button ZoomInBTN;
|
public Button ZoomInBTN;
|
||||||
public Button ZoomOutBTN;
|
public Button ZoomOutBTN;
|
||||||
public Button ZoomResetBTN;
|
public Button ZoomResetBTN;
|
||||||
public Button WaveformBTN;
|
|
||||||
public Slider PlaybackSpeed;
|
public Slider PlaybackSpeed;
|
||||||
|
|
||||||
public Vector3[] LayerCorners = new Vector3[4];
|
public Vector3[] LayerCorners = new Vector3[4];
|
||||||
|
@ -244,40 +243,13 @@ namespace HeavenStudio.Editor.Track
|
||||||
|
|
||||||
LoadRemix();
|
LoadRemix();
|
||||||
|
|
||||||
TimelineSlider.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
// TimelineSlider.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
||||||
TimelineSlider.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
// TimelineSlider.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
||||||
TimelineSlider.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
// TimelineSlider.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
||||||
TimelineSlider.GetChild(3).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
// TimelineSlider.GetChild(3).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
|
||||||
TimelineSongPosLineRef.GetComponent<Image>().color = EditorTheme.theme.properties.CurrentTimeMarkerCol.Hex2RGB();
|
// TimelineSongPosLineRef.GetComponent<Image>().color = EditorTheme.theme.properties.CurrentTimeMarkerCol.Hex2RGB();
|
||||||
TimelineSongPosLineRef.gameObject.SetActive(false);
|
TimelineSongPosLineRef.gameObject.SetActive(false);
|
||||||
|
|
||||||
PlayBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
if (Conductor.instance.isPaused)
|
|
||||||
PlayCheck(false);
|
|
||||||
else
|
|
||||||
PlayCheck(true);
|
|
||||||
});
|
|
||||||
PauseBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused)
|
|
||||||
PlayCheck(false);
|
|
||||||
});
|
|
||||||
StopBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
if (Conductor.instance.isPlaying || Conductor.instance.isPaused)
|
|
||||||
PlayCheck(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
MetronomeBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
MetronomeToggle();
|
|
||||||
});
|
|
||||||
AutoplayBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
AutoPlayToggle();
|
|
||||||
});
|
|
||||||
|
|
||||||
SelectionsBTN.onClick.AddListener(delegate
|
SelectionsBTN.onClick.AddListener(delegate
|
||||||
{
|
{
|
||||||
timelineState.SetState(CurrentTimelineState.State.Selection);
|
timelineState.SetState(CurrentTimelineState.State.Selection);
|
||||||
|
@ -295,25 +267,6 @@ namespace HeavenStudio.Editor.Track
|
||||||
timelineState.SetState(CurrentTimelineState.State.ChartSection);
|
timelineState.SetState(CurrentTimelineState.State.ChartSection);
|
||||||
});
|
});
|
||||||
|
|
||||||
ZoomInBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
zoomComponent.Zoom(0.25f * zoomComponent.Scale.x, Vector2.zero, true);
|
|
||||||
});
|
|
||||||
ZoomOutBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
zoomComponent.Zoom(-0.2f * zoomComponent.Scale.x, Vector2.zero, true);
|
|
||||||
});
|
|
||||||
ZoomResetBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
zoomComponent.ResetZoom();
|
|
||||||
});
|
|
||||||
WaveformBTN.onClick.AddListener(delegate
|
|
||||||
{
|
|
||||||
WaveformToggle();
|
|
||||||
});
|
|
||||||
|
|
||||||
Tooltip.AddTooltip(WaveformBTN.gameObject, "Waveform Toggle");
|
|
||||||
|
|
||||||
SetTimeButtonColors(true, false, false);
|
SetTimeButtonColors(true, false, false);
|
||||||
MetronomeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
MetronomeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
MetronomeBTN.transform.GetChild(1).GetComponent<Image>().color = Color.gray;
|
MetronomeBTN.transform.GetChild(1).GetComponent<Image>().color = Color.gray;
|
||||||
|
@ -326,6 +279,33 @@ namespace HeavenStudio.Editor.Track
|
||||||
resizeCursor = Resources.Load<Texture2D>("Cursors/horizontal_resize");
|
resizeCursor = Resources.Load<Texture2D>("Cursors/horizontal_resize");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PressPlay()
|
||||||
|
{
|
||||||
|
PlayCheck(!Conductor.instance.isPaused);
|
||||||
|
}
|
||||||
|
public void PressPause()
|
||||||
|
{
|
||||||
|
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused) {
|
||||||
|
PlayCheck(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void PressStop()
|
||||||
|
{
|
||||||
|
if (Conductor.instance.isPlaying || Conductor.instance.isPaused) {
|
||||||
|
PlayCheck(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// public void SetState(CurrentTimelineState.State state)
|
||||||
|
// {
|
||||||
|
// timelineState.SetState(state);
|
||||||
|
// }
|
||||||
|
|
||||||
|
public void SetState(string state)
|
||||||
|
{
|
||||||
|
timelineState.SetState(Enum.Parse<CurrentTimelineState.State>(state));
|
||||||
|
}
|
||||||
|
|
||||||
public void FitToSong()
|
public void FitToSong()
|
||||||
{
|
{
|
||||||
var currentSizeDelta = RealTimelineContent.sizeDelta;
|
var currentSizeDelta = RealTimelineContent.sizeDelta;
|
||||||
|
@ -338,12 +318,6 @@ namespace HeavenStudio.Editor.Track
|
||||||
RealTimelineContent.sizeDelta = new Vector2(TimelineContent.sizeDelta.x / Zoom, RealTimelineContent.sizeDelta.y);
|
RealTimelineContent.sizeDelta = new Vector2(TimelineContent.sizeDelta.x / Zoom, RealTimelineContent.sizeDelta.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateWaveform()
|
|
||||||
{
|
|
||||||
// DrawWaveform();
|
|
||||||
// StartCoroutine(DrawWaveformRealtime());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AutoBtnUpdate()
|
public void AutoBtnUpdate()
|
||||||
{
|
{
|
||||||
var animName = GameManager.instance.autoplay ? "Idle" : "Disabled";
|
var animName = GameManager.instance.autoplay ? "Idle" : "Disabled";
|
||||||
|
@ -584,7 +558,7 @@ namespace HeavenStudio.Editor.Track
|
||||||
|
|
||||||
private void SliderControl()
|
private void SliderControl()
|
||||||
{
|
{
|
||||||
TimelinePlaybackBeat.text = $"Beat {string.Format("{0:0.000}", PlaybackBeat)}";
|
TimelinePlaybackBeat.text = $"♪ {string.Format("{0:0.000}", PlaybackBeat)}";
|
||||||
|
|
||||||
if (TimelineSongPosLineRef != null && !Conductor.instance.WaitingForDsp)
|
if (TimelineSongPosLineRef != null && !Conductor.instance.WaitingForDsp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace HeavenStudio.Editor.Track
|
||||||
private Vector2 relMousePos;
|
private Vector2 relMousePos;
|
||||||
|
|
||||||
private RectTransform rectTransform;
|
private RectTransform rectTransform;
|
||||||
|
private RectTransform timelineContentRectTrans;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
@ -28,10 +29,9 @@ namespace HeavenStudio.Editor.Track
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
var scrollDeltaY = Input.mouseScrollDelta.y;
|
var scrollDeltaY = Input.mouseScrollDelta.y;
|
||||||
if (scrollDeltaY != 0)
|
if (scrollDeltaY != 0 && Timeline.instance.MouseInTimeline)
|
||||||
{
|
{
|
||||||
if (Timeline.instance.MouseInTimeline)
|
OnScroll(scrollDeltaY);
|
||||||
OnScroll(scrollDeltaY);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,41 +41,51 @@ namespace HeavenStudio.Editor.Track
|
||||||
|
|
||||||
relMousePos = rectTransform.anchoredPosition;
|
relMousePos = rectTransform.anchoredPosition;
|
||||||
|
|
||||||
Vector2 relativeMousePosition;
|
|
||||||
|
|
||||||
var cam = Editor.instance.EditorCamera;
|
var cam = Editor.instance.EditorCamera;
|
||||||
if (cam == null)
|
if (cam == null)
|
||||||
{
|
{
|
||||||
Debug.LogError("Camera not set!");
|
Debug.LogError("Camera not set!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, cam, out relativeMousePosition);
|
|
||||||
|
|
||||||
if (scrollDeltaY > 0)
|
if (scrollDeltaY > 0) {
|
||||||
{
|
if (Input.GetKey(KeyCode.LeftControl)) {
|
||||||
if (Input.GetKey(KeyCode.LeftControl))
|
ZoomInVertical();
|
||||||
{
|
} else {
|
||||||
Zoom(0.25f * _scale.y, relativeMousePosition, false);
|
ZoomInHorizontal();
|
||||||
}
|
}
|
||||||
else
|
} else if (scrollDeltaY < 0) {
|
||||||
{
|
if (Input.GetKey(KeyCode.LeftControl)) {
|
||||||
Zoom(0.25f * _scale.x, relativeMousePosition, true);
|
ZoomOutVertical();
|
||||||
|
} else {
|
||||||
|
ZoomOutHorizontal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scrollDeltaY < 0)
|
}
|
||||||
{
|
|
||||||
if (Input.GetKey(KeyCode.LeftControl))
|
public void ZoomInVertical()
|
||||||
{
|
{
|
||||||
var incre = -0.2f * _scale.y;
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
|
||||||
if (_scale.y + incre > minScale - 0.1f)
|
Zoom(0.25f * _scale.y, mousePos, false);
|
||||||
Zoom(-0.2f * _scale.y, relativeMousePosition, false);
|
}
|
||||||
}
|
public void ZoomInHorizontal()
|
||||||
else
|
{
|
||||||
{
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
|
||||||
var incre = -0.2f * _scale.x;
|
Zoom(0.25f * _scale.x, mousePos, true);
|
||||||
if (_scale.x + incre > minScale - 0.1f)
|
}
|
||||||
Zoom(-0.2f * _scale.x, relativeMousePosition, true);
|
public void ZoomOutVertical()
|
||||||
}
|
{
|
||||||
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
|
||||||
|
var incre = -0.2f * _scale.y;
|
||||||
|
if (_scale.y + incre > minScale - 0.1f)
|
||||||
|
Zoom(-0.2f * _scale.y, mousePos, false);
|
||||||
|
}
|
||||||
|
public void ZoomOutHorizontal()
|
||||||
|
{
|
||||||
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
|
||||||
|
var incre = -0.2f * _scale.x;
|
||||||
|
if (_scale.x + incre > minScale - 0.1f) {
|
||||||
|
Zoom(-0.2f * _scale.x, mousePos, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +136,8 @@ namespace HeavenStudio.Editor.Track
|
||||||
{
|
{
|
||||||
_scale.Set(1, 1, 1);
|
_scale.Set(1, 1, 1);
|
||||||
rectTransform.localScale = _scale;
|
rectTransform.localScale = _scale;
|
||||||
|
rectTransform.localPosition = new Vector2(rectTransform.localPosition.x, 0);
|
||||||
|
timelineContentRectTrans.sizeDelta = new Vector2(timelineContentRectTrans.sizeDelta.x, 320);
|
||||||
Timeline.instance.OnZoom(_scale.x);
|
Timeline.instance.OnZoom(_scale.x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
8
Assets/Scripts/LevelEditor/ZoomDialog.meta
Normal file
8
Assets/Scripts/LevelEditor/ZoomDialog.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 57d18db3e40dbf34391199ee47cecd0d
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
14
Assets/Scripts/LevelEditor/ZoomDialog/ZoomDialog.cs
Normal file
14
Assets/Scripts/LevelEditor/ZoomDialog/ZoomDialog.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using HeavenStudio.Editor.Track;
|
||||||
|
|
||||||
|
using TMPro;
|
||||||
|
|
||||||
|
namespace HeavenStudio.Editor
|
||||||
|
{
|
||||||
|
public class ZoomDialog : Dialog
|
||||||
|
{
|
||||||
|
// empty rn. keep it this way!
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/LevelEditor/ZoomDialog/ZoomDialog.cs.meta
Normal file
11
Assets/Scripts/LevelEditor/ZoomDialog/ZoomDialog.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aeb3c233812091c44899fa5535852773
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in a new issue