Hi Guys,
Could someone help me to understand why the code below won’t compile?
MonoDevelop gives me the following error: “A get or set accessor expected” where the “if” statement is.
using UnityEngine;
using System.Collections;
public enum MenuStates {None, Localization, Menu, Tutorial, MainGame}
public class MenuCanvasController : MonoBehaviour {
public MenuStates m_MenuState = MenuStates.None;
public MenuStates MenuState
{
get{ return m_MenuState; }
set{ m_MenuState = value; }
}
if (m_MenuState == MenuStates.None)
Debug.Log("FooBar");
}