- Home /
Question by
mirek_mazur · Apr 14, 2018 at 08:22 AM ·
return valueexpressionlambda
Messaging System ,return value
Hi all
I am trying to use the Unity Messaging System. I have an interface
public interface ICustomMessageTarget : IEventSystemHandler
{
bool Message1();
}
.... class that contains a method to execiute
public class CustomMessageTarget : MonoBehaviour, ICustomMessageTarget
{
public bool Message1()
{
// do something
return true;
}
}
... and function "SomeFunction" which calls "ExecuteEvents.Execute" with the parameter "Message1"
public void SomeFuncion()
{
bool ReturnBool = ExecuteEvents.Execute<ICustomMessageTarget> (SomeObject, null, (x, y) =>
x.Message1();
}
I would like "Message 1" return bool value to "SomeFunction" Unfortunately above code will show an error. How to do it that "Message 1" returns bool value to "SomeFunction"?
Comment
Your answer

Follow this Question
Related Questions
anonymous functions with JavaScript? 2 Answers
C# lambda call in for loop references to last object 3 Answers
IL2CPP compiled expressions performance 2 Answers
Returning new class from a method not working 1 Answer
Random Movment using if statments 2 Answers