48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EnterPrizesAvailableState : IState
|
|
{
|
|
NumberInput numberInput;
|
|
GameManager gm;
|
|
|
|
IState prevState;
|
|
|
|
public EnterPrizesAvailableState(IState prevState)
|
|
{
|
|
this.prevState = prevState;
|
|
}
|
|
|
|
public void enter()
|
|
{
|
|
gm = GameManager.instance;
|
|
|
|
numberInput = gm.prizesAvailableInput;
|
|
numberInput.gameObject.SetActive(true);
|
|
numberInput.Initialize();
|
|
}
|
|
|
|
public void exit() => numberInput.gameObject.SetActive(false);
|
|
|
|
public void update()
|
|
{
|
|
|
|
int continiousDir = 0;
|
|
if (In.GetButtonAnyPlayer(PlayerAction.left)) continiousDir -= 1;
|
|
if (In.GetButtonAnyPlayer(PlayerAction.right)) continiousDir += 1;
|
|
|
|
numberInput.SwitchValue(continiousDir);
|
|
|
|
if (In.GetButtonDownAnyPlayer(PlayerAction.down))
|
|
{
|
|
numberInput.AcceptAndClose();
|
|
|
|
//обратный переход
|
|
//gm.stateMachine.ChangeState(new SettingsState());
|
|
gm.stateMachine.ChangeState(prevState);
|
|
}
|
|
|
|
}
|
|
}
|