AwesomeRunner/Assets/Scripts/Player/ArrowKeysInput.cs
VladimirPirozhenko 45b277e7d1 Initial commit
2022-08-07 07:31:16 +03:00

31 lines
820 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArrowKeysInput : IPlayerInput //ÑÄÅËÀÒÜ ÌÎÍÎÁÅÕ È Ñ×ÈÒÛÂÀÒÜ ÈÍÏÓÒ ÏÎÑÒÎßÍÍÎ Â ÀÏÄÅÉÒ, ÑÄÅËÀÒÜ ÃÅÒÈÍÏÓÒ?
{
public bool IsShooting()
{
if (Input.GetKeyDown(KeyCode.F))
return true;
return false;
}
EInputDirection? IPlayerInput.ScanDirection()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
return EInputDirection.UP;
else if (Input.GetKeyDown(KeyCode.DownArrow))
return EInputDirection.DOWN;
else if (Input.GetKeyDown(KeyCode.RightArrow))
return EInputDirection.RIGHT;
else if (Input.GetKeyDown(KeyCode.LeftArrow))
return EInputDirection.LEFT;
else
return null;
}
}