rimworld-animation-studio/Assets/Scripts/GUI/QuiverToggle.cs
AbstractConcept 757badf4f6 Code refactor
2022-10-27 00:56:04 -05:00

26 lines
727 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class QuiverToggle : MonoBehaviour
{
public void Update()
{
PawnKeyframe keyframe = Workspace.GetCurrentOrPreviousKeyframe(Workspace.ActorID);
GetComponent<Toggle>().isOn = keyframe != null && keyframe.Quiver;
}
public void OnValueChanged()
{
PawnKeyframe keyframe = Workspace.GetCurrentOrPreviousKeyframe(Workspace.ActorID);
if (keyframe != null)
{ keyframe.Quiver = GetComponent<Toggle>().isOn; }
Workspace.RecordEvent("Actor quiver");
}
}
}