コード例 #1
0
    void OnDestroy()
    {
        Debug.Log("OnDestroy UTH called");
        foreach (var thread in registeredThreads)
        {
            Debug.Log("Disposing a thread...");
            thread.Dispose();
        }


        if (dispatcher != null)
        {
            dispatcher.Dispose();
        }
        dispatcher = null;

        if (taskDistributor != null)
        {
            taskDistributor.Dispose();
        }
        taskDistributor = null;

        if (instance == this)
        {
            instance = null;
        }
    }
コード例 #2
0
    private void EnsureHelperInstance()
    {
        if (dispatcher == null)
        {
            dispatcher = new UnityThreading.Dispatcher();
        }

        if (taskDistributor == null)
        {
            taskDistributor = new UnityThreading.TaskDistributor();
        }
    }
コード例 #3
0
    private void EnsureHelperInstance()
    {
        if (dispatcher == null)
        {
            dispatcher = new UnityThreading.Dispatcher();
        }

        if (taskDistributor == null)
        {
            taskDistributor = new UnityThreading.TaskDistributor();
        }

        isWebPlayer = Application.isPlayer;
    }
コード例 #4
0
    void OnDestroy()
    {
        foreach (var thread in registeredThreads)
        {
            thread.Dispose();
        }

        if (dispatcher != null)
        {
            dispatcher.Dispose();
        }
        dispatcher = null;

        if (taskDistributor != null)
        {
            taskDistributor.Dispose();
        }
        taskDistributor = null;
    }
コード例 #5
0
    void OnDestroy()
    {
        foreach (var thread in registeredThreads)
        {
            thread.Dispose();
        }

        if (dispatcher != null)
        {
            dispatcher.Dispose();
        }
        dispatcher = null;

        if (taskDistributor != null)
        {
            taskDistributor.Dispose();
        }
        taskDistributor = null;

        //maybe must be fixed! :P
//        if (instance == this)
//            instance = null;
    }
コード例 #6
0
 private void EnsureHelperInstance()
 {
     dispatcher      = UnityThreading.Dispatcher.MainNoThrow ?? new UnityThreading.Dispatcher();
     taskDistributor = UnityThreading.TaskDistributor.MainNoThrow ?? new UnityThreading.TaskDistributor("TaskDistributor");
 }