mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 10:07:38 +02:00
copy entities, prep settings menu
This commit is contained in:
@ -48,12 +48,13 @@ namespace HeavenStudio.Editor
|
||||
[SerializeField] private Button UndoBTN;
|
||||
[SerializeField] private Button RedoBTN;
|
||||
[SerializeField] private Button MusicSelectBTN;
|
||||
[SerializeField] private Button EditorSettingsBTN;
|
||||
[SerializeField] private Button EditorThemeBTN;
|
||||
[SerializeField] private Button FullScreenBTN;
|
||||
[SerializeField] private Button TempoFinderBTN;
|
||||
[SerializeField] private Button SnapDiagBTN;
|
||||
|
||||
[SerializeField] private Button EditorThemeBTN;
|
||||
[SerializeField] private Button EditorSettingsBTN;
|
||||
|
||||
[Header("Tooltip")]
|
||||
public TMP_Text tooltipText;
|
||||
|
||||
@ -102,12 +103,12 @@ namespace HeavenStudio.Editor
|
||||
Tooltip.AddTooltip(UndoBTN.gameObject, "Undo <color=#adadad>[Ctrl+Z]</color>");
|
||||
Tooltip.AddTooltip(RedoBTN.gameObject, "Redo <color=#adadad>[Ctrl+Y or Ctrl+Shift+Z]</color>");
|
||||
Tooltip.AddTooltip(MusicSelectBTN.gameObject, "Music Select");
|
||||
Tooltip.AddTooltip(EditorSettingsBTN.gameObject, "Editor Settings <color=#adadad>[Ctrl+Shift+O]</color>");
|
||||
Tooltip.AddTooltip(EditorThemeBTN.gameObject, "Editor Theme");
|
||||
Tooltip.AddTooltip(FullScreenBTN.gameObject, "Preview <color=#adadad>[Tab]</color>");
|
||||
Tooltip.AddTooltip(TempoFinderBTN.gameObject, "Tempo Finder");
|
||||
Tooltip.AddTooltip(SnapDiagBTN.gameObject, "Snap Settings");
|
||||
|
||||
Tooltip.AddTooltip(EditorSettingsBTN.gameObject, "Editor Settings <color=#adadad>[Ctrl+Shift+O]</color>");
|
||||
UpdateEditorStatus(true);
|
||||
}
|
||||
|
||||
|
8
Assets/Scripts/LevelEditor/SettingsDialog.meta
Normal file
8
Assets/Scripts/LevelEditor/SettingsDialog.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 907f7d1eb5d90af408aa531ea366e63e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
27
Assets/Scripts/LevelEditor/SettingsDialog/SettingsDialog.cs
Normal file
27
Assets/Scripts/LevelEditor/SettingsDialog/SettingsDialog.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Editor.Track;
|
||||
|
||||
using TMPro;
|
||||
|
||||
namespace HeavenStudio.Editor
|
||||
{
|
||||
public class SettingsDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject settingsMenu;
|
||||
|
||||
private void Start() {}
|
||||
|
||||
public void SwitchSettingsDialog()
|
||||
{
|
||||
if(settingsMenu.activeSelf) {
|
||||
settingsMenu.SetActive(false);
|
||||
} else {
|
||||
settingsMenu.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update() {}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d82cc04699de2e54483ca0e0468d9ed2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -611,6 +611,14 @@ namespace HeavenStudio.Editor.Track
|
||||
return eventObj;
|
||||
}
|
||||
|
||||
public TimelineEventObj CopyEventObject(Beatmap.Entity e)
|
||||
{
|
||||
Beatmap.Entity clone = (Beatmap.Entity) e.Clone();
|
||||
TimelineEventObj dup = AddEventObject(clone.datamodel, false, new Vector3(clone.beat, -clone.track * Timeline.instance.LayerHeight()), clone, true, RandomID());
|
||||
|
||||
return dup;
|
||||
}
|
||||
|
||||
public void DestroyEventObject(Beatmap.Entity entity)
|
||||
{
|
||||
if (EventParameterManager.instance.entity == entity)
|
||||
|
@ -41,6 +41,7 @@ namespace HeavenStudio.Editor.Track
|
||||
private bool resizingLeft;
|
||||
private bool resizingRight;
|
||||
private bool inResizeRegion;
|
||||
private bool wasDuplicated;
|
||||
public Vector2 lastMovePos;
|
||||
public bool isCreating;
|
||||
public string eventObjID;
|
||||
@ -167,6 +168,13 @@ namespace HeavenStudio.Editor.Track
|
||||
|
||||
if (Timeline.instance.eventObjs.FindAll(c => c.moving).Count > 0 && selected)
|
||||
{
|
||||
//duplicate the entity if holding alt or r-click
|
||||
if ((!wasDuplicated) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetMouseButton(1)))
|
||||
{
|
||||
wasDuplicated = true;
|
||||
var te = Timeline.instance.CopyEventObject(entity);
|
||||
}
|
||||
|
||||
Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||
|
||||
lastPos_ = transform.localPosition;
|
||||
@ -291,6 +299,7 @@ namespace HeavenStudio.Editor.Track
|
||||
}
|
||||
|
||||
moving = false;
|
||||
wasDuplicated = false;
|
||||
|
||||
Cancel();
|
||||
if (isCreating == true)
|
||||
|
Reference in New Issue
Block a user