using UnityEngine;

using System.Collections;


public class ExSwitch2 : MonoBehaviour {


// Use this for initialization

void Start () {

string[] Country = new string[]{"KOREA", "JAPAN", "USA", "MEXICO", "FRANCE", "ENGLAND", "GABONG"} ;

//string country = "USA";

for(int i = 0; i < Country.Length; i++){

string text = Country[i] + " = " + " ";

string text1;

switch(Country[i]){

case "KOREA":

//print(text + "Asia");

case "JAPAN":

text1 = "ASIA";

print(text + text1);

break;

case "USA":

//print(text + "America");

case "MEXICO":

text1 = "ASIA";

print(text + text1);

break;

case "FRANCE":

text1 = "Europe";

print( text + text1);

break;

default:

text1 = "Unknown";

print (text + text1);

break;

}

//print (Country[i] + " - " + Country);

}

}

// Update is called once per frame

void Update () {

}

}



'Computer Language > 유니티' 카테고리의 다른 글

등차수열  (0) 2014.04.07
쾌걸 zoro  (0) 2014.04.07
정수값을 입력받고 문자로 치환해서 성적 구하기.(배열 if switch)  (0) 2014.04.07
배열과 if문 활용하여 성적 출력하기  (0) 2014.04.07
핀볼게임  (0) 2014.04.05

+ Recent posts