GlobalGameJame/Library/PackageCache/com.unity.timeline@1.2.10/Editor/Manipulators/AddDelete/AddDeleteItemModeMix.cs
JonatanRek bea2dce063 Initial
test
2020-01-31 16:10:04 +01:00

27 lines
801 B
C#

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.duration);
ItemsUtils.SetItemsStartTime(itemsGroups, validTime);
}
}
public void RemoveItems(IEnumerable<ItemsPerTrack> itemsGroups)
{
// Nothing
}
}
}