mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
New paste functions plus keyframe drag select
This commit is contained in:
parent
3d2c11f469
commit
f449a9b4e2
117 changed files with 399 additions and 81 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue