/// Invoke the Action in the end of the frame. If the Action is null, it does nothing. /// public static void DelayInvoke(this Action action) { if (action != null) { GlobalDirector.WaitForFrame(action); } }
/// Invoke the Action in the end of the frame. If the Action is null, it does nothing. /// /// @param param /// The parameter of the Action /// public static void DelayInvoke<Type>(this Action<Type> action, Type param) { if (action != null) { GlobalDirector.WaitForFrame(() => { action.Invoke(param); }); } }
/// Invoke the Action in the end of the frame. If the Action is null, it does nothing. /// /// @param paramA /// The first parameter of the Action /// @param paramB /// The second parameter of the Action /// @param [optional] emptyAction /// Whether the action should be emptied after invoking /// public static void DelayInvoke<TypeA, TypeB>(this Action<TypeA, TypeB> action, TypeA paramA, TypeB paramB) { if (action != null) { GlobalDirector.WaitForFrame(() => { action.Invoke(paramA, paramB); }); } }