Singularity/Library/PackageCache/com.unity.timeline@1.6.4/Editor/Manipulators/AddDelete/AddDeleteItemModeMix.cs

27 lines
796 B
C#
Raw Normal View History

2024-05-06 14:45:45 -04:00
using System;
using System.Collections.Generic;
using System.Linq;
namespace UnityEditor.Timeline
{
class AddDeleteItemModeMix : IAddDeleteItemMode
{
public void InsertItemsAtTime(IEnumerable<ItemsPerTrack> itemsGroups, double requestedTime)
{
ItemsUtils.SetItemsStartTime(itemsGroups, requestedTime);
EditModeMixUtils.PrepareItemsForInsertion(itemsGroups);
if (!EditModeMixUtils.CanInsert(itemsGroups))
{
var validTime = itemsGroups.Select(c => c.targetTrack).Max(parent => parent.end);
ItemsUtils.SetItemsStartTime(itemsGroups, validTime);
}
}
public void RemoveItems(IEnumerable<ItemsPerTrack> itemsGroups)
{
// Nothing
}
}
}