Code refactor

This commit is contained in:
AbstractConcept 2022-10-31 19:58:41 -05:00
parent e14a12f2ab
commit af4dab5546
278 changed files with 468 additions and 668 deletions

View file

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace RimWorldAnimationStudio
{
public class SnapToKeyframe : MonoBehaviour, IDragHandler
{
private Slider slider;
public void Start()
{
slider = GetComponent<Slider>();
}
public void OnDrag(PointerEventData eventData)
{
int targetTick = Workspace.FindClosestKeyFrameAtTick((int)slider.value, Mathf.CeilToInt(Workspace.StageWindowSize * 0.01f));
if (Input.GetKey(KeyCode.LeftShift))
{ slider.value = (float)targetTick; }
}
}
}