rimworld-animation-studio/Assets/Scripts/GUI/QuiverToggle.cs

27 lines
727 B
C#
Raw Normal View History

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