using System.Collections;
public class Ex6_9 : MonoBehaviour {
void MyMethod_0(int a = 0){
print(a);
}
void MyMethod_1(int a = 0, int b = 0){
print (a + " " + b);
}
void MyMethod_2(int a, int b, int c = 10, int d = 20){
print (a + ", " + b + ", " + c + ", " + d);
}
void PrintProfile(string name = "KIM", string phone = "010"){
print (name + "," + phone);
}
// Use this for initialization
void Start () {
MyMethod_0();
MyMethod_1(20);
MyMethod_2(20, 30);
PrintProfile();
PrintProfile("Park");
PrintProfile(phone:"020-494-4844");
PrintProfile("Park", "010-33939-3333");
}
// Update is called once per frame
void Update () {
}
}
'Computer Language > 유니티' 카테고리의 다른 글
좌우로 움직이는 로봇 (0) | 2014.04.29 |
---|---|
추축축 (0) | 2014.04.28 |
: 을 이용 출력 순서가 바뀌어도 상관이 없다. (0) | 2014.04.22 |
params (0) | 2014.04.22 |
params 가변인자 (0) | 2014.04.22 |