- Home /
 
Answer by Badeye · Dec 12, 2016 at 07:59 AM
Return a value from the called method or call a custom event, like this:
 public static MyCallbackEvent onCallBack = new MyCallbackEvent();
 public class MyCallbackEvent : UnityEvent<optionalType> {}
 
               Remove the <> brackets if you do not want to pass a type.
Invoke the event:
 onCallBack.Invoke(optionalType);
 
               Listen to the event:
 onCallBack.AddListener(CallbackListenerFunction);
 public void CallbackListenerFunction(optional type)
 {
 // do stuff
 }
 
              Your answer
 
             Follow this Question
Related Questions
problem with loop / unity crash 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
For loop not working as intended?!? (Beginner) 1 Answer
C# List looping Vector3's 2 Answers