WENZHAO LI
  • Home
  • Modeling
  • TechArtBlog
  • PythonMAYA
  • About

TechART Blog

Delegates and Events in Unity

2/21/2018

0 Comments

 
http://www.unitygeek.com/delegates-events-unity/
https://unity3d.com/cn/learn/tutorials/topics/scripting/delegates
https://unity3d.com/cn/learn/tutorials/topics/scripting/events

Delegate A Delegate is a reference pointer to a method. It allows us to treat method as a variable and pass method as a variable for a callback. When it get called , it notifies all methods that reference the delegate. The basic idea behind them is exactly the same as a subscription magazine. Anyone can subscribe to the service and they will receive the update at the right time automatically.
Events Adds a layer of abstraction and protection on delegate, this protection prevents client of the delegate from resetting the delegate and invocation list. Events only allow to add and remove method from invocation list.
0 Comments



Leave a Reply.

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    January 2021
    November 2020
    October 2019
    September 2019
    February 2019
    November 2018
    July 2018
    February 2018

    Categories

    All

    RSS Feed

© COPYRIGHT 2019. ALL RIGHTS RESERVED.
  • Home
  • Modeling
  • TechArtBlog
  • PythonMAYA
  • About