52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EnterNumberTech : IState
|
|
{
|
|
TextInput textInput;
|
|
GameManager gm;
|
|
IState prevState;
|
|
|
|
public EnterNumberTech(IState prevState)
|
|
{
|
|
this.prevState = prevState;
|
|
}
|
|
|
|
//private string name;
|
|
public void enter()
|
|
{
|
|
gm = GameManager.instance;
|
|
|
|
textInput = gm.NumberTech;
|
|
textInput.gameObject.SetActive(true);
|
|
textInput.Initialize();
|
|
}
|
|
|
|
public void exit() => textInput.gameObject.SetActive(false);
|
|
|
|
public void update()
|
|
{
|
|
int discreteDir = 0;
|
|
if (In.GetButtonDown(InSignal.left1)) discreteDir -= 1;
|
|
if (In.GetButtonDown(InSignal.right1)) discreteDir += 1;
|
|
|
|
int continiousDir = 0;
|
|
if (In.GetButton(InSignal.left2)) continiousDir -= 1;
|
|
if (In.GetButton(InSignal.right2)) continiousDir += 1;
|
|
|
|
textInput.SwitchSlot(discreteDir);
|
|
textInput.SwitchLetter(continiousDir);
|
|
|
|
if (In.GetButtonDownAnyPlayer(PlayerAction.down))
|
|
{
|
|
//PlayerPrefs.SetString("Price", textInput.AcceptAndClose());
|
|
|
|
//переход
|
|
//gm.stateMachine.ChangeState(new SettingsState());
|
|
gm.stateMachine.ChangeState(prevState);
|
|
}
|
|
|
|
}
|
|
}
|