rimworld-animation-studio/Assets/Scripts/GUI/AnimationDefCard.cs
2022-09-17 19:06:33 -05:00

47 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class AnimationDefCard : MonoBehaviour
{
public InputField defNameField;
public InputField labelField;
public Toggle playSoundsToggle;
public void Initialize()
{
defNameField.text = Workspace.animationDef.defName;
labelField.text = Workspace.animationDef.label;
playSoundsToggle.isOn = Workspace.animationDef.sounds;
}
public void UpdateAnimationDef()
{
Workspace.animationDef.defName = defNameField.text;
Workspace.animationDef.label = labelField.text;
Workspace.animationDef.sounds = playSoundsToggle.isOn;
}
public void OpenSelectSexTypesDialog()
{
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectSexTypesDialog)) as SelectSexTypesDialog[];
if (dialog != null)
{ dialog[0].Initialize(); dialog[0].Pop(); }
}
public void OpenSelectInteractionDefsDialog()
{
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectInteractionDefsDialog)) as SelectInteractionDefsDialog[];
if (dialog != null)
{ dialog[0].Initialize(); dialog[0].Pop(); }
}
}
}