New paste functions plus keyframe drag select

This commit is contained in:
AbstractConcept 2022-10-13 00:33:18 -05:00
parent 3d2c11f469
commit f449a9b4e2
117 changed files with 399 additions and 81 deletions

View file

@ -5,16 +5,20 @@ using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace RimWorldAnimationStudio
{
public class AnimationTimeline : MonoBehaviour
public class AnimationTimeline : MonoBehaviour, IPointerClickHandler
{
public int actorID;
public KeyframeSlider keyframeSliderPrefab;
private Transform anchorTransform;
public void Initialize(int actorID)
{
anchorTransform = transform.parent;
this.actorID = actorID;
Reset();
@ -71,8 +75,8 @@ namespace RimWorldAnimationStudio
public void OnMoveTimeline(int delta)
{
int? siblingIndex = transform.parent.GetComponentsInChildren<AnimationTimeline>()?.ToList()?.IndexOf(this);
int? siblingCount = transform.parent.GetComponentsInChildren<AnimationTimeline>()?.ToList()?.Count();
int? siblingIndex = anchorTransform.parent.GetComponentsInChildren<AnimationTimeline>()?.ToList()?.IndexOf(this);
int? siblingCount = anchorTransform.parent.GetComponentsInChildren<AnimationTimeline>()?.ToList()?.Count();
if (siblingIndex != null && siblingCount != null && MoveAnimationTimeline(siblingIndex.Value, delta))
{
@ -102,5 +106,11 @@ namespace RimWorldAnimationStudio
return true;
}
public void OnPointerClick(PointerEventData eventData)
{
Workspace.actorID = actorID;
Workspace.keyframeID.Clear();
}
}
}