委托与事件(二)

2017-11-18  本文已影响0人  土豆_9724

大家好,我是北京菜鸟在线的unity3d 高级讲师,范老师,这次我们接着上次的内容继续

(3-1) 我们还可以用这样的方法来求上述的题目:运行程序,我们发现,两种方法运行的结果一样。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
委托(delegate),用于封装函数。

(4) 多播委托

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
委托(delegate),用于封装函数。

(4-1) 委托的其它用法,如下图,其中第3条不怎么用,所以我们就略过了。


image

匿名函数的委托;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
委托(delegate),用于封装函数。 委托一般不是自己用的,是给别人用的。如果自己用的话,一般不用委托

}

《完》

上一篇 下一篇

猜你喜欢

热点阅读