AwesomeRunner/Assets/Scripts/Input/ArrowKeysInput.cs
VladimirPirozhenko 4fa18a41a0 Changed animation strings to hashes, added IPoolable interface, upgrade pool system
Change generation of obstacles
Now all the important objects is cointained by pools
2022-08-09 22:23:49 +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;
}
}