180bpm
C#에서의 제네릭 클래스를 사용 본문
반응형
매번 헤깔렸었다.
using UnityEngine; using System.Collections; using System; public class TempClass : MonoBehaviour { public void callSample() { sampleData data = new sampleData(); data.dataIndex = 15000; data.message = "testMessage"; NetworkTest.Send<sampleData>(data, OnComplete, OnFailed); } public void OnComplete() { Debuger.Log("성공"); } public void OnFailed() { Debuger.Log("실패"); } } public class sampleData { public int dataIndex; public string message; } public class NetworkTest { public static void Send<T>(T Data, Action OnComplete, Action OnFailed = null) where T : class { } }
반응형
Comments