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 }
public GetNetworkTime(UnbiasedTime timeManager, float abordTime = 3) { this.abordTime = abordTime; ThreadStart threadStart = new ThreadStart(delegate { time = timeManager.TryToGetTime(out isSuccess); }); thread = new Thread(threadStart); }