// Update is called once per frame void Update() { if (GameStateManager.GetCurrentState() == GameStateManager.Types.Build) { currentMode = MenuMode.GetCurrentMode(); currentselected = radialControllerMenu.getSelected().GetComponent <Location>().name; if (previousMode != currentMode) { UpdateText(); } if (previousselected != currentselected) { UpdateSelected(); } if (radialControllerMenu.getSelected().GetComponent <Location>().NumberAllowed <= radialControllerMenu.GetNumberPlacedSelectedItem()) { PlacedText.color = new Color(255, 0, 0); PlacedText.text = ("No More Available"); } else { PlacedText.color = new Color(2, 134, 146); PlacedText.text = (radialControllerMenu.getSelected().GetComponent <Location>().NumberAllowed - radialControllerMenu.GetNumberPlacedSelectedItem()) + " Available"; } previousselected = currentselected; previousMode = currentMode; } else { StopTextDisplay(); } }
// Use this for initialization void Start() { mode = GetComponent <MenuMode>(); currentMode = MenuMode.GetCurrentMode(); TopText.text = GetTopText(currentMode); BottomText.text = GetBottomText(currentMode); selected = radialControllerMenu.getSelected(); currentselected = selected.GetComponent <Location>().name; previousMode = currentMode; previousselected = currentselected; }