Unity3D/Tips

[펌] 지역 코드 얻어오기

blueasa 2018. 2. 22. 16:16

http://ip2c.org/ 에 25$ 기부하고 사용하기로 결정.


c#에서는 아래와 같은 함수를 만들어서 간단히 이용 가능함.


public IEnumerator getGeoIP(){


if (DataManager.Inst.psd.systemOpt.nation.Length == 0) {

WWW www = new WWW ("http://ip2c.org/self");

while (!www.isDone) {

yield return new WaitForSeconds (0.1f);

}


if (www.text.Length > 1) {

string[] listnation = www.text.Split (';');

Debug.Log( listnation [2] );

}

}

}


각 국가의 국기 이미지 처리 방법 


http://www.gamedevforever.com/301



출처: http://ongamedev.tistory.com/entry/지역-코드-얻어오기 [가끔 보자, 하늘.]

반응형