Hook _hook = Hook.Get(); void PrintThis( string s ) { Log.Info(s); } void PrintThis2( string s ) { Log.Info(s); Log.Info("2" + s); }
// add some events _hook.Add("OnEvent", "doThis", PrintThis) _hook.Add("OnEvent", "alsoThis", PrintThis2)
// call the event _hook.Call("OnEvent", "param") // // Outputs: // "param" // "param" // "2param" //
// remove the events for some reason _hook.Remove("doThis") _hook.Remove("alsoThis")