Example #1
0
    public static void FlushDebug(DebugLogDelegate Callback)
    {
        //	if we have no listeners, do fast flush
        bool HasListeners = (Callback != null) && (Callback.GetInvocationList().Length > 0);

        if (HasListeners)
        {
            //	IOS (and aot-only platforms cannot get a function pointer. Find a workaround!
#if UNITY_IOS && !UNITY_EDITOR
            FlushDebug(System.IntPtr.Zero);
#else
            FlushDebug(Marshal.GetFunctionPointerForDelegate(Callback));
#endif
        }
        else
        {
            FlushDebug(System.IntPtr.Zero);
        }
    }
Example #2
0
    static public void Update()
    {
        //	if we have no listeners, do fast flush
        bool HasListeners = (DebugDelegate != null) && (DebugDelegate.GetInvocationList().Length > 0);

        HasListeners &= (mDebugLogDelegate != null) && (mDebugLogDelegate.GetInvocationList().Length > 0);
        if (HasListeners)
        {
            FlushDebug(Marshal.GetFunctionPointerForDelegate(mDebugLogDelegate));
        }
        else
        {
            FlushDebug(System.IntPtr.Zero);
        }

        //	pop all jobs
        bool More = PopJob(Marshal.GetFunctionPointerForDelegate(mOnJobDelegate));

        while (More)
        {
            More = PopJob(Marshal.GetFunctionPointerForDelegate(mOnJobDelegate));
        }
    }