rimworld-animation-studio/Assets/Scripts/Keybind.cs
AbstractConcept 3d859555ad UI 2.0
2022-10-12 00:22:29 -05:00

34 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using UnityEngine;
namespace RimWorldAnimationStudio
{
public class Keybind
{
public string command;
public bool requiresAnimationDef = true;
public bool repeatable = false;
public KeybindData win;
public KeybindData mac;
[XmlIgnore] public List<KeyCode> keyModifiers { get { return GetKeybindData().keyModifiers; } }
[XmlIgnore] public KeyCode keyCode { get { return GetKeybindData().keyCode; } }
private KeybindData GetKeybindData()
{
bool runningOSX = Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor;
return runningOSX ? mac : win;
}
}
public class KeybindData
{
[XmlArray("keyModifiers"), XmlArrayItem("li")] public List<KeyCode> keyModifiers = new List<KeyCode>();
public KeyCode keyCode = KeyCode.None;
}
}