I want a var to be equal to a class element var

So I want my string selectProvinceName to be equal to the Parana element Name, see screenshot, how should i proceed?

using UnityEngine;
using System.Collections;

public class ProvincesScript : MonoBehaviour {

	public string selectProvinceName;


	[System.Serializable]
	public class Provinces {

		public string Name;
		public int ID;


	}
	public Provinces[] prov;

	public enum States{parana = 0, saopaulo = 1}
	public States currentState;

	public void selParana(){
		currentState = States.parana;
	}
	public void selSaopaulo(){
		currentState = States.saopaulo;
	}

	public void Update(){
		if(currentState = States.parana)
			selectProvinceName = Provinces.


	}

}

48184-screen.png

selectedProvinceName = prov[0].Name;

Provinces[0] refers back to the class Provinces, so trying to access it’s index, doesn’t make sense. You can only ask for the index of an array element, which then gives you the expected value.

You could use case. Like this

switch (currentState)
{
   case States.Parana:
   {
       selectProvinceName = Provinces[0].Name;
   }
   case States.Saopaulo:
   {
      selectProvinceName = Provinces[1].Name;
   }
}