mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
26 lines
788 B
C#
26 lines
788 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.Instance.GetCurrentOrPreviousKeyframe(Workspace.actorID);
|
|
GetComponent<Toggle>().isOn = keyframe != null && keyframe.quiver.HasValue && keyframe.quiver.Value;
|
|
}
|
|
|
|
public void OnValueChanged()
|
|
{
|
|
PawnKeyframe keyframe = Workspace.Instance.GetCurrentOrPreviousKeyframe(Workspace.actorID);
|
|
|
|
if (keyframe != null)
|
|
{ keyframe.quiver = GetComponent<Toggle>().isOn; }
|
|
|
|
Workspace.Instance.RecordEvent("Actor quiver");
|
|
}
|
|
}
|
|
}
|