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

29 lines
685 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class AddSoundDefButton : MonoBehaviour
{
private Text text;
public void Start()
{
text = GetComponentInChildren<Text>();
}
void Update()
{
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
{ text.text = keyframe.SoundEffect == null || keyframe.SoundEffect == "" ? "None" : keyframe.SoundEffect; }
else
{ text.text = "None"; }
}
}
}