コード例 #1
0
ファイル: ThreadedJob.cs プロジェクト: xBambusekD/ar2cor
        public GetNetworkTime(UnbiasedTime timeManager, float abordTime = 3)
        {
            this.abordTime = abordTime;

#if UNITY_EDITOR
            ThreadStart threadStart = new ThreadStart(delegate
            {
                time = timeManager.TryToGetTime(out isSuccess);
            });
            thread = new Thread(threadStart);
#endif
#if !UNITY_EDITOR
            task = new Task(() => {
                Debug.Log("TASK STARTED");
                timeManager.TryToGetTime();
                while (!timeManager.timeReceived)
                {
                    Debug.Log("Waiting for time...." + isSuccess);
                }
                time      = timeManager.milliseconds;
                isSuccess = timeManager.timeReceived;

                Debug.Log("TIME RECEIVED!");
                timeManager.timeReceived = false;
            });
#endif
        }
コード例 #2
0
ファイル: ThreatedJob.cs プロジェクト: temresen/unbiasedtime
        public GetNetworkTime(UnbiasedTime timeManager, float abordTime = 3)
        {
            this.abordTime = abordTime;
            ThreadStart threadStart = new ThreadStart(delegate
            {
                time = timeManager.TryToGetTime(out isSuccess);
            });

            thread = new Thread(threadStart);
        }