Computer Language/유니티

함수의 활용법.. 로그 이쁘게 찍기

알 수 없는 사용자 2014. 4. 11. 15:47

using UnityEngine;

using System.Collections;


public class ExPrintChar : MonoBehaviour {

// Use this for initialization

void Start () {

PrintChar ("A", 4, 3);

}

/*

void PrintChar(string ch, int x, int y){

string text;

for(int i = 0; i < x; i++){

text = "";

for(int j = 0; j < y; j++){

text = text + ch;

}

print (text);

}

}

*/

void PrintChar(string ch, int x, int y){

PrintLine ("-", 0, y + 2, "-");

for(int i = 0; i < x; i++){

PrintLine(ch, 1, y, "|");

}

PrintLine ("-", 0, y + 2 , "-");

}

void PrintLine(string ch, int pos, int y, string ch2){

string t = "";

for(int j = 0; j < pos; j++){

t = t + ch2;

}

for(int j = 0; j < y; j++){

t = t + ch;

}

print (t);

}

// Update is called once per frame

void Update () {

}

}