rimworld-animation-studio/Assets/Scripts/Managers/InputManager.cs

43 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace RimWorldAnimationStudio
{
public class InputManager : Singleton<InputManager>
{
public void Update()
{
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.Z))
{ Workspace.Instance.Undo(); }
else if (Input.GetKey(KeyCode.LeftCommand) && Input.GetKeyDown(KeyCode.Z))
{ Workspace.Instance.Undo(); }
else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.Y))
{ Workspace.Instance.Redo(); }
else if (Input.GetKey(KeyCode.LeftCommand) && Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Z))
{ Workspace.Instance.Redo(); }
else if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.LeftCommand)) && Input.GetKeyDown(KeyCode.C))
{ AnimationController.Instance.ClonePawnKeyframe(); }
else if (Input.GetKey(KeyCode.Backspace) || Input.GetKey(KeyCode.Delete))
{ AnimationController.Instance.RemovePawnKeyframe(); }
else if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.LeftCommand)) && Input.GetKeyDown(KeyCode.N))
{ ApplicationManager.Instance.TryToMakeNewAnimation(); }
else if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.LeftCommand)) && Input.GetKeyDown(KeyCode.S))
{ ApplicationManager.Instance.TryToSaveAnimation(); }
else if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.LeftCommand)) && Input.GetKeyDown(KeyCode.L))
{ ApplicationManager.Instance.TryToLoadAnimation(); }
}
}
}