mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
34 lines
1 KiB
C#
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;
|
|
}
|
|
}
|