using UnityEngine;

using System.Collections;


public class Chap3 : MonoBehaviour {


// Use this for initialization

void Start () {

//bool isStudent = false;

System.Boolean isStudent = false;

int age1 = 10;

int age2 = 30;

if(age1<19)

isStudent = true;

else

isStudent = false;

print ("age1 isStudent ="  + isStudent);

if(age2<19)

isStudent = true;

else

isStudent = false;

print ("age2 isStudent ="  + isStudent);

}

// Update is called once per frame

void Update () {

}


int age1 = 10;

bool isArmy = 20 <=age1  && age1 < 30;

print("age1 isStudent = " + isArmy);



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

C# String Format  (0) 2014.03.31
형변환  (0) 2014.03.31
이스케이프 문자  (0) 2014.03.31
문자형  (0) 2014.03.31
실수를 많이 해서 실수형.  (0) 2014.03.31

void Start () {

string text = @"\tHello\nWorld";

print (text);

string text2 = "\\tHello\\nWorld";

print (text2);

string text3 = "\tHello\nWorld";

print (text3);

}

}


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

형변환  (0) 2014.03.31
boolean  (0) 2014.03.31
문자형  (0) 2014.03.31
실수를 많이 해서 실수형.  (0) 2014.03.31
자료형(실수)  (0) 2014.03.31

public class Chap3 : MonoBehaviour {


// Use this for initialization

void Start () {

char ch1 = 'a';

char ch2 = 'b';

char ch3 = '\\';

char t = '\t';

char n = '\n';

string e = "Hello" + n + t + t + "World";   //앞에 더 크면 뒤에꺼 자동 형변환 해줌니다.

string a = "Hello, World";

string b = "Hello,\tWorld";

string c = "Hello,\nWorld";

string d = e + c;

print ("ch1 " + ch1);

print ("ch2 " + ch2);

print ("ch3 " + ch3);

print ("a " + a);

print ("b" + b);

print ("c " + c);

print ("d" + d);

}

// Update is called once per frame

void Update () {

}

}


char 2바이트 연산이 안된다. char tostring으로 바꿔줘야 한다.




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

boolean  (0) 2014.03.31
이스케이프 문자  (0) 2014.03.31
실수를 많이 해서 실수형.  (0) 2014.03.31
자료형(실수)  (0) 2014.03.31
자료형(정수)  (0) 2014.03.31

+ Recent posts