mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:37:37 +02:00
copy entities, prep settings menu
This commit is contained in:
@ -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