작업소스 http://freebox.myqnapcloud.com:8080/share.cgi?ssid=05TshSe using UnityEngine; using System.Collections; using System; // System 네임스페이스 Action을 사용하려면 System 네임스페이스가 있어야 한다. // 코루틴 콜백 1초뒤에 값을 콜백 public class CallBackTest : MonoBehaviour { void Start() { // 3 : 값을 적용 StartCoroutine(Get(10, 20, Add)); } // 2 : 적용된 값을 출력 void Add( int result) { print( "result " + result); } // 1 : 1초 뒤에 정해진 값을 fun(result); result에 넣어주고 IEnumerator Get( int a, int b, Action < int > fun) //Action = 델리게이트 { yield return new WaitForSeconds (1); int result = a + b; fun(result); } } == https://graph.facebook.com/857177887702829/picture <- 페이스북 사진 주소 ===== [ 정보 클래스 싱글턴으로 만들기 ] ===== using UnityEngine; using System.Collections; using System.Collections.Generic; // 플레이어( 친구 정보를 담을 클래스) public class UserItem {
댓글
댓글 쓰기