When I create the new method at 1:14 in the video I am getting a ‘ManageState’: member name cannot be the same as their enclosing type error.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ManageState : MonoBehaviour
{
[SerializeField] Text textComponent;
[SerializeField] State startingState;
State state;
// Start is called before the first frame update
void Start()
{
state = startingState;
textComponent.text = state.GetStateStory();
}
// Update is called once per frame
void Update()
{
ManageState();
}
private void ManageState()
{
var nextStates = state.GetNextStates();
if (Input.GetKeyDown(KeyCode.Alpha1))
{
state = nextStates[0];
}
else if (Input.GetKeyDown(KeyCode.Alpha2))
{
state = nextStates[1];
}
else if (Input.GetKeyDown(KeyCode.Alpha3))
{
state = nextStates[2];
}
textComponent.text = state.GetStateStory();
}
}