using UnityEngine;

using System.Collections;


public class NameCard{

private int age;

private string name;

public int Age

{

get{return age;}

set{ age = value;}

}

public string Name

{

get{return name;}

set{ name = value;}

}

}


public class test : MonoBehaviour {


// Use this for initialization

void Start () {

NameCard MyCard = new NameCard();

MyCard.Age = 24;

MyCard.Name = "SUNG SUCK";

print(string.Format("age : {0}", MyCard.Age));

print(string.Format("name : {0}", MyCard.Name));

}

// Update is called once per frame

void Update () {

}

}




using UnityEngine;

using System.Collections;


public class test2 : MonoBehaviour {


// Use this for initialization

void Start () {

var nameCard = new { Name="hamgwangho", Age=123} ;

print (string.Format("Name:{0}, Age:{1}", nameCard.Name, nameCard.Age));

var complex = new { Real = 3, Imaginary = -12} ;

print (string.Format("Real:{0}, Imaginary:{1}", complex.Real, complex.Imaginary));

}

// Update is called once per frame

void Update () {

}

}




+ Recent posts