static void RegisterInCallerOverTime(FunctionAndParams p_struct, float p_time) { if (p_struct != null) { if (p_time <= 0) { p_struct.CallFunction(); } else { FunctionsToCallOverTime.AddChecking(p_time, p_struct); } } }
public static void CallFunction(System.Delegate p_functionPointer, object[] p_params, float p_time, bool p_tryCreateInstance = true) { if (p_tryCreateInstance && Application.isPlaying) { TryCreateInstance(); } else { Init(); } FunctionAndParams v_newStruct = new FunctionAndParams(); v_newStruct.DelegatePointer = p_functionPointer; v_newStruct.Params = p_params != null? new List <object>(p_params) : new List <object>(); v_newStruct.Target = null; if (p_time <= 0) { p_time = 0.001f; } RegisterInCallerOverTime(v_newStruct, p_time); }