Unity3d perform a callback from multiple scripts
<p>I have a problem with callback function in C# script in Unity. </p>

<p>In Corona SDK if you want to perform a callback, you just need to pass it as an argument and then call it in proper place.</p>

<pre><code>local function boom()
    print("booom!!!")
end

local function bang()
    print("baaaang!!!")
end

local function selector(var, func1, func2)
    if var &gt; 0 then
        func1()
    else
        func2()
    end
end

selector(5, boom, bang)
selector(-12, boom, bang)
</code></pre>

<p>And I get:</p>

<pre><code>booom!!!
baaaang!!!
</code></pre>

<p>Which is correct.</p>

<p>But when I try to implement it in C# script in Unity I have plenty of problems. First of all, passing just a parameter is not enough. You need to specify type of variable in <code>selector()</code> function. So I have to specify class name for <code>func1</code> and <code>func2</code>. But if I want to be able to call it from multiple scripts and pass different callback functions? Then I'm unable to specify class as a type.</p>

<p>I found few tutorials, but none of them solved my problem. They all describe how to do it within a class or only from a predefined class</p>