Skip to content

Commit

Permalink
Fixed compilation errors when Unity is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
NibbleByte committed Mar 11, 2024
1 parent ab1daa6 commit 41e2505
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion WiseTiming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,13 @@ public WiseCoroutine StartCoroutine(IEnumerator routine, object source, SourceIn

coroutine.DebugInfo = new DebugInfo {
CreatedTimeInMilliseconds = TimeElapsedInMilliseconds,
#if USE_UNITY
CreatedUnityTime = UnityEngine.Time.time,
CreatedUnityFrame = UnityEngine.Time.frameCount,
#else
CreatedUnityTime = (float) (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalSeconds,
CreatedUnityFrame = (int) (DateTime.Now - Process.GetCurrentProcess().StartTime).Ticks,
#endif
StackTrace = DebugInfo_RecordCallstack ? new StackTrace() : null,
};

Expand Down Expand Up @@ -741,12 +746,13 @@ private ScheduleAction UpdateCoroutine(WiseCoroutineImpl coroutine, ScheduleActi
{
// NOTE: to debug this class, remove the "[DebuggerNonUserCode]" attribute above, or disable "Just My Code" feature of Visual Studio.

#if USE_UNITY

// Check if source was destroyed and kill the coroutine if true.
if (coroutine.Source is UnityEngine.Object unitySource && unitySource == null) {
return ScheduleAction.Finished;
}

#if USE_UNITY
if (coroutine.InactiveBehaviour != SourceInactiveBehaviour.KeepExecuting) {
bool sourceIsInactive =
(coroutine.Source is Behaviour behaviourSource && !behaviourSource.isActiveAndEnabled) ||
Expand Down

0 comments on commit 41e2505

Please sign in to comment.