예제 #1
0
 public void Awake()
 {
     if (this.myCustomEvent == null)
     {
         this.myCustomEvent = new MyCustomUnityEvent();
     }
 }
예제 #2
0
 public void OnDisable()
 {
     this.myEvents.myCustomEvent -= MyMethod;
 }
예제 #3
0
 // Allows to drag and drop the slower Unity Event on the
 // faster delegate events when needed.
 // If you only work via scripting you get the faster
 // delegate events. If you work via drag and drop
 // you take a small overhead by calling the UnityEvent in the delegate.
 public void OnEnable()
 {
     this.myEvents = base.GetComponent <CSharpEvents>();
     this.myEvents.myCustomEvent += MyMethod;
 }