Func<TResult> Delegate
Unity3D/C# 2015. 4. 6. 11:18https://msdn.microsoft.com/en-us/library/bb534960(v=vs.110).aspx
http://www.dotnetperls.com/func
http://www.codeproject.com/Articles/114854/Looking-in-Func-Delegates
using UnityEngine; using System.Collections; using System; public class FuncTest : MonoBehaviour { Func<string> myfunc; private static string SayHello() { return "Hello Dude!!"; } void Start () { myfunc = SayHello; string returnedString = myfunc(); Debug.Log(returnedString); } // Update is called once per frame void Update () { } }
'Unity3D > C#' 카테고리의 다른 글
[Design Pattern] Factory Method (0) | 2015.09.02 |
---|---|
Delegate를 메서드 파라미터로 전달 (0) | 2015.04.06 |
A Beginner's Tutorial on Implementing IEnumerable Interface and Understanding yield Keyword (0) | 2015.04.03 |
extension method. (0) | 2015.02.25 |
중복 제거 방법 HashSet (0) | 2015.02.24 |