Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene load timing fix #339

Merged
merged 130 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
2355bc5
basic 1 frame delay logic
Eddio0141 Nov 29, 2024
6ce30ec
all frame delays are processed, even stalled ones
Eddio0141 Nov 29, 2024
39429cd
handle non-async scene load flushing all async scene loads properly
Eddio0141 Nov 29, 2024
eab6827
updated
Eddio0141 Nov 29, 2024
53147d4
fixed duplicate AsyncOperation instance creations
Eddio0141 Nov 29, 2024
c22cefd
scene unload properly fails if done multiple times
Eddio0141 Nov 29, 2024
cea8589
better logs
Eddio0141 Nov 30, 2024
043b8e6
handle getting scene struct during async load
Eddio0141 Dec 4, 2024
67596b0
check API use and warn
Eddio0141 Dec 4, 2024
89728e0
disable warning for pointer operation
Eddio0141 Dec 4, 2024
a8a05cc
properly throw exception when setting name
Eddio0141 Dec 4, 2024
f529f40
removed unused logic
Eddio0141 Dec 4, 2024
d9117f7
use reverse patcher to prevent stack overflow
Eddio0141 Dec 4, 2024
55b2e64
fix unit tests failing
Eddio0141 Dec 4, 2024
962bea6
duplicate scene unload would result in exception
Eddio0141 Dec 5, 2024
92a2ab7
handle invalid scene loads / unloads properly
Eddio0141 Dec 5, 2024
cf6461e
unload operations forces progress to 0
Eddio0141 Dec 6, 2024
6ec7bbb
fixed scene loading delay from single -> additional loads
Eddio0141 Dec 8, 2024
8fee8d4
scene loading has a delay, and loads one after the other
Eddio0141 Dec 9, 2024
c46ff92
better handling of object to DynValue
Eddio0141 Dec 10, 2024
a2d23ae
removed invalid trailing newline
Eddio0141 Dec 11, 2024
e7d4ffd
merge legacy scene load patch to unitas managed async op
Eddio0141 Dec 13, 2024
377cdb6
instance to address as object extension
Eddio0141 Dec 13, 2024
1d4c414
patch SetActiveScene to redirect dummy scene struct to real
Eddio0141 Dec 13, 2024
93fb9eb
this is supposed to work
Eddio0141 Dec 14, 2024
79bfe58
fixed most scene loading issues
Eddio0141 Dec 15, 2024
f0040d8
unload failure gets ignored causing desync in scene count
Eddio0141 Dec 16, 2024
97114e5
fail unload if there's only 1 scene
Eddio0141 Dec 16, 2024
db6fadd
scene unload logic is slightly fixed
Eddio0141 Dec 16, 2024
7566957
proper handling of unload op and extra Scene struct overrides
Eddio0141 Dec 18, 2024
d1f9641
fixed scene unloading
Eddio0141 Dec 19, 2024
5461b5d
handle valid check if immediate flag is set
Eddio0141 Dec 19, 2024
ba1b867
more explicit logging
Eddio0141 Dec 19, 2024
496e11b
prevent crashing from invalid handle
Eddio0141 Dec 20, 2024
6c2db81
fixed scene info not passed / checked properly
Eddio0141 Dec 20, 2024
a3efbca
don't use reverse invoker for safe wrapper
Eddio0141 Dec 20, 2024
f1d3562
handle get / set subScene
Eddio0141 Dec 20, 2024
5cfb299
small async operation data override clean up
Eddio0141 Dec 22, 2024
b8d7ebe
refactor to be accurate
Eddio0141 Dec 22, 2024
c8053c8
turns out unity documents is a lie, yield null can be faster than Update
Eddio0141 Dec 22, 2024
6c7cc2a
fixed small issues
Eddio0141 Dec 22, 2024
4d5882f
faster way to grab m_Ptr
Eddio0141 Dec 22, 2024
90d5408
implementation of all other async operations
Eddio0141 Dec 23, 2024
f80daff
fixed logic error, removed debug prints
Eddio0141 Dec 23, 2024
0633a50
handle rest of async operations
Eddio0141 Dec 23, 2024
4ca5871
warn async operation use, fixed timing of an async op, small fixes
Eddio0141 Dec 23, 2024
1cced1b
added coroutine skip
Eddio0141 Dec 24, 2024
84f24e7
more logs and combine patches
Eddio0141 Dec 25, 2024
1573f1c
don't accidentally track unitas coroutines
Eddio0141 Dec 26, 2024
6979598
fixed logic
Eddio0141 Dec 26, 2024
75b09a6
null check
Eddio0141 Dec 26, 2024
8f75e1e
don't stop update on update pause
Eddio0141 Dec 26, 2024
8763f1c
added missing exception reporting on coroutines
Eddio0141 Dec 26, 2024
ced02b1
extra logging
Eddio0141 Dec 26, 2024
940f768
simplify
Eddio0141 Dec 27, 2024
444ec3f
added missing overload
Eddio0141 Dec 27, 2024
83777a5
extra log
Eddio0141 Dec 27, 2024
d675956
more debug logging
Eddio0141 Dec 27, 2024
267bc92
fixed broken logic
Eddio0141 Dec 27, 2024
5f4c5fc
fixed using the wrong type
Eddio0141 Dec 27, 2024
efe5d2d
don't pause coroutine calls
Eddio0141 Dec 27, 2024
3b37084
fixed broken patch
Eddio0141 Dec 27, 2024
fa9c721
extra log
Eddio0141 Dec 28, 2024
a69fa38
don't have coroutine update invoke just in case
Eddio0141 Dec 28, 2024
d680337
extra logging
Eddio0141 Dec 28, 2024
c9a533e
added pausing to coroutines
Eddio0141 Dec 28, 2024
cd1cc8f
fixed log
Eddio0141 Dec 29, 2024
c3a6425
time measured in frame count instead
Eddio0141 Dec 29, 2024
24fa061
don't log GUI calls
Eddio0141 Dec 29, 2024
eb6e63f
fixed handling coroutine, added extra logging
Eddio0141 Dec 29, 2024
a66eced
reduce noisy logging
Eddio0141 Dec 29, 2024
0b30024
removed redundant prefix
Eddio0141 Dec 29, 2024
c29088c
fixed coroutine override, and faster reflection search
Eddio0141 Dec 30, 2024
68a0606
callback for some ops are different in timing
Eddio0141 Dec 30, 2024
a0d86d4
hook on WaitForEndOfFrame
Eddio0141 Dec 30, 2024
ef21c6d
fixed missing callback calls
Eddio0141 Dec 31, 2024
00d56dc
fixed failing unit tests
Eddio0141 Dec 31, 2024
9053b1a
allow modification during iteration
Eddio0141 Dec 31, 2024
1008b8a
properly force callback on untracked instances
Eddio0141 Jan 1, 2025
8d75bb6
swap yield timing
Eddio0141 Jan 1, 2025
7b88df3
avoid exception on iteration
Eddio0141 Jan 2, 2025
82c6da0
fixed existing config, added DebugTest
Eddio0141 Jan 2, 2025
9a541fd
swap structuremap with ninject
Eddio0141 Jan 3, 2025
f63d803
fixed DI problem
Eddio0141 Jan 3, 2025
e52f677
log error instead
Eddio0141 Jan 3, 2025
37e252f
extra check and logs
Eddio0141 Jan 3, 2025
262d969
log warning
Eddio0141 Jan 4, 2025
406089c
fixed FixedUpdate not being invoked correctly internally
Eddio0141 Jan 4, 2025
182fd71
Revert "swap structuremap with ninject"
Eddio0141 Jan 4, 2025
f039b04
swap log order
Eddio0141 Jan 5, 2025
5b70ced
fix log
Eddio0141 Jan 5, 2025
7386ae0
directly grab new IEnumerator for MonoBehaviour
Eddio0141 Jan 5, 2025
30791f6
guarantee running InvokeEndOfFrame correctly
Eddio0141 Jan 5, 2025
bf23825
trace log scene stack
Eddio0141 Jan 5, 2025
4a04d92
fixed broken patches
Eddio0141 Jan 5, 2025
3cd1791
fixed loading unity assembly too early
Eddio0141 Jan 6, 2025
d999d59
should be faster
Eddio0141 Jan 6, 2025
cbd9126
explicit log messages
Eddio0141 Jan 6, 2025
86e85a0
fixed asset bundle request data giving weird results
Eddio0141 Jan 6, 2025
7105e55
extra log detail
Eddio0141 Jan 6, 2025
24743d9
stop running end of frame updates twice every frame
Eddio0141 Jan 7, 2025
13c6eb6
cleaner code
Eddio0141 Jan 7, 2025
60ed2d6
extra logs
Eddio0141 Jan 7, 2025
d1e0165
fixed broken FixedUpdate detection
Eddio0141 Jan 8, 2025
8951d2a
prevent null reference exception
Eddio0141 Jan 8, 2025
069a35e
small adjustments
Eddio0141 Jan 8, 2025
df74e5d
adjustments and cleanup
Eddio0141 Jan 9, 2025
150713c
all IEnumerator are patched for tracking in preloader instead
Eddio0141 Jan 10, 2025
2af7f3a
fixed processing yield in the wrong order
Eddio0141 Jan 10, 2025
fc7d9ab
fixed patch
Eddio0141 Jan 10, 2025
4b7968e
patched unload unused assets operation
Eddio0141 Jan 11, 2025
806a644
check for full MoveNext name
Eddio0141 Jan 11, 2025
f34fd12
don't patch value type
Eddio0141 Jan 11, 2025
6d7f19d
partially fix forced asset loading via property access
Eddio0141 Jan 11, 2025
e1faa11
complete asset bundle request in async operation queue
Eddio0141 Jan 11, 2025
f28f0f4
fixed other operations to use standard operation queueing
Eddio0141 Jan 11, 2025
7da61bf
resource unload should also be queued in standard operation queue
Eddio0141 Jan 11, 2025
868d4ed
consider abstract classes
Eddio0141 Jan 12, 2025
9859840
properly guarantee unloading asset bundles
Eddio0141 Jan 12, 2025
62fce6d
basic fix for name based bundle scene matching
Eddio0141 Jan 12, 2025
63a9887
basic check for name / full path scene loading from asset bundles
Eddio0141 Jan 13, 2025
0cf0616
partial implementation on handling full / partial / minimum scene paths
Eddio0141 Jan 14, 2025
e1c0cae
support for partial scene path searching
Eddio0141 Jan 15, 2025
9c83428
fixed broken path lookup
Eddio0141 Jan 15, 2025
d4ff7d7
wrap method calls with try catch and log error
Eddio0141 Jan 17, 2025
8ce9372
null check to prevent looking up invalid key
Eddio0141 Jan 17, 2025
be9245d
extra null checks
Eddio0141 Jan 18, 2025
2c5dacd
get scene functions check from loading dummy scenes instead of all du…
Eddio0141 Jan 18, 2025
e2389ba
removed pointless null checks, added some safety check though
Eddio0141 Jan 18, 2025
fefb601
updated
Eddio0141 Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed Baldi's basics itch.io throwing exceptions during TAS playback
- Fixed Resonance Of The Ocean not saving some information at the start
- Fixed Cat Quest 2 from soft locking in the first cave
- Fixed Untitled Goose Game breaking when restarting level

### UniTAS

Expand All @@ -21,7 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Compatibility

- **MAYBE BREAKING**: Setting async operation activation to true won't instantly load, which was the case before which is inaccurate
- **BREAKING**: Async scene load is not supposed to be instant, there is a frame of delay before loading
- **BREAKING**: Async operations in unity now follows a queue of operations, so if a scene load operation happens, rest of the operations stop until scene loads
- **BREAKING**: Setting async operation activation to true won't instantly load, which was the case before which is inaccurate
- AsyncOperation's InvokeCompletionEvent is only disabled for tracked AsyncOperation instances
- Implemented LoadScene forcing pending LoadSceneAsync to be all loaded
- Fixed accidentally obliterating return value of LoadScene instances
Expand Down
47 changes: 47 additions & 0 deletions UniTAS/Patcher.Tests/Extensions/MethodDelegateTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using UniTAS.Patcher.Extensions;

namespace Patcher.Tests.Extensions;

public class MethodDelegateTests
{
private struct TestStruct
{
public int Value;
public void Increment() => Value++;
public string ReturnValue() => Value.ToString();
}

private delegate void TestStructRefDelegate(ref TestStruct testStruct);

private delegate void TestStructObjectRefDelegate(ref object testStruct);

[Fact]
public void StructRefDelegateMutate()
{
var increment = typeof(TestStruct).GetMethod(nameof(TestStruct.Increment))!;

var incrementDel = increment.MethodDelegate<TestStructRefDelegate>(delegateArgs:
[typeof(TestStruct).MakeByRefType()]);
var instance = new TestStruct();
incrementDel(ref instance);
Assert.Equal(1, instance.Value);

var incrementDel2 = increment.MethodDelegate<TestStructObjectRefDelegate>(delegateArgs:
[typeof(object).MakeByRefType()]);
var instanceWrap = (object)instance;
incrementDel2(ref instanceWrap);
Assert.Equal(2, ((TestStruct)instanceWrap).Value);
}

[Fact]
public void StructDelegateInvoke()
{
var instance = new TestStruct();
instance.Value++;

var returnValue = typeof(TestStruct).GetMethod(nameof(TestStruct.ReturnValue))!;
var returnValueDel = returnValue.MethodDelegate<Func<object, string>>();
Assert.Equal("1", returnValueDel(instance));
}
}
17 changes: 14 additions & 3 deletions UniTAS/Patcher.Tests/KernelUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,18 @@ public void RemoveBackendEntry(string key)
}

[Register(IncludeDifferentAssembly = true)]
public class SceneManagerWrapperDummy : ISceneWrapper
public class ISceneManagerManagerWrapperDummy : ISceneManagerWrapper
{
public void LoadSceneAsync(string sceneName, int sceneBuildIndex, LoadSceneMode loadSceneMode,
LocalPhysicsMode localPhysicsMode, bool mustCompleteNextFrame)
{
}

public void UnloadSceneAsync(string sceneName, int sceneBuildIndex, object options, bool immediate, out bool success)
{
success = false;
}

public void LoadScene(int buildIndex)
{
}
Expand All @@ -217,8 +222,14 @@ public void LoadScene(string name)
public int TotalSceneCount => 0;
public int ActiveSceneIndex => 0;
public string ActiveSceneName => "";
public int SceneCount { get; set; }
public bool TrackSceneCount { get; set; }
public int LoadedSceneCountDummy { get; set; }
public bool TrackSceneCountDummy { get; set; }
public int SceneCount => 0;

public SceneWrapper GetSceneAt(int index)
{
throw new NotImplementedException();
}
}

[Register(IncludeDifferentAssembly = true)]
Expand Down
6 changes: 5 additions & 1 deletion UniTAS/Patcher.Tests/Patcher.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<LangVersion>12</LangVersion>

<Configurations>ReleaseTest</Configurations>
<Configurations>ReleaseTest;DebugTest</Configurations>

<Platforms>AnyCPU</Platforms>

Expand All @@ -23,6 +23,10 @@
<Optimize>true</Optimize>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'DebugTest' ">
<Optimize>false</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using UniTAS.Patcher.Models.DependencyInjection;
using UniTAS.Patcher.Services.GameExecutionControllers;
using UniTAS.Patcher.Utils;
Expand Down Expand Up @@ -25,4 +27,6 @@ public static bool PausedUpdate
get => _monoBehaviourController.PausedUpdate;
set => _monoBehaviourController.PausedUpdate = value;
}

public static HashSet<IEnumerator> IgnoreCoroutines => _monoBehaviourController.IgnoreCoroutines;
}
57 changes: 54 additions & 3 deletions UniTAS/Patcher/Extensions/MethodBaseExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
Expand Down Expand Up @@ -97,7 +98,20 @@ public static TDelegateType MethodDelegate<TDelegateType>(
parameterTypes[0] = declaringType;
for (var i = 0; i < numParameters; i++)
parameterTypes[i + 1] = parameters[i].ParameterType;
var delegateArgsResolved = delegateArgs ?? delegateType.GetGenericArguments();
// special handling for Func
var delegateArgsResolved = delegateArgs;
if (delegateArgsResolved == null && delegateType.IsGenericType && delegateType.GetGenericTypeDefinition()
.SaneFullName().StartsWith("System.Func`"))
{
var args = delegateType.GetGenericArguments().ToList();
args.RemoveAt(args.Count - 1); // return
delegateArgsResolved = args.ToArray();
}
else if (delegateArgsResolved == null)
{
delegateArgsResolved = delegateType.GetGenericArguments();
}

var dynMethodReturn = delegateArgsResolved.Length < parameterTypes.Length
? parameterTypes
: delegateArgsResolved;
Expand All @@ -109,10 +123,37 @@ public static TDelegateType MethodDelegate<TDelegateType>(
// OwnerType = declaringType
};
var ilGen = dmd.GetILGenerator();
if (declaringType is { IsValueType: true } && !delegateArgsResolved[0].IsByRef)
LocalBuilder valueTypeHolder = null;
if (declaringType is { IsValueType: true } && !delegateArgsResolved[0].IsByRef &&
(declaringType == delegateArgsResolved[0] || delegateArgsResolved[0].IsSubclassOf(declaringType)))
ilGen.Emit(OpCodes.Ldarga_S, 0);
// if `ref object` for instance, you would want a return
else if (declaringType is { IsValueType: true } &&
!(delegateArgsResolved[0].GetElementType() ?? delegateArgsResolved[0]).IsValueType)
{
if (delegateArgsResolved[0].IsByRef)
{
valueTypeHolder = ilGen.DeclareLocal(declaringType);

// unbox and store to temp
ilGen.Emit(OpCodes.Ldarg_0);
ilGen.Emit(OpCodes.Ldind_Ref);
ilGen.Emit(OpCodes.Unbox_Any, declaringType);
ilGen.Emit(OpCodes.Stloc, valueTypeHolder);
ilGen.Emit(OpCodes.Ldloca, valueTypeHolder);
}
else
{
var tempHolder = ilGen.DeclareLocal(declaringType);
ilGen.Emit(OpCodes.Ldarg_0);
ilGen.Emit(OpCodes.Unbox_Any, declaringType);
ilGen.Emit(OpCodes.Stloc, tempHolder);
ilGen.Emit(OpCodes.Ldloca, tempHolder);
}
}
else
ilGen.Emit(OpCodes.Ldarg_0);

for (var i = 1; i < parameterTypes.Length; i++)
{
ilGen.Emit(OpCodes.Ldarg, i);
Expand All @@ -125,8 +166,18 @@ public static TDelegateType MethodDelegate<TDelegateType>(
}

ilGen.Emit(OpCodes.Call, method);

if (valueTypeHolder != null)
{
// replace ref
ilGen.Emit(OpCodes.Ldarg_0);
ilGen.Emit(OpCodes.Ldloc, valueTypeHolder);
ilGen.Emit(OpCodes.Box, declaringType);
ilGen.Emit(OpCodes.Stind_Ref);
}

ilGen.Emit(OpCodes.Ret);
return (TDelegateType)dmd.Generate().CreateDelegate(delegateType);
return dmd.Generate().CreateDelegate<TDelegateType>();
}

// Closed instance method delegate that virtually calls
Expand Down
65 changes: 65 additions & 0 deletions UniTAS/Patcher/Extensions/ObjectExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections;
using System.Reflection;
using MoonSharp.Interpreter;
using MoonSharp.Interpreter.Interop.Converters;

namespace UniTAS.Patcher.Extensions;

public static class ObjectExtensions
{
public static DynValue ToDynValue(this object obj, Script script)
{
if (obj == null)
return DynValue.Nil;

DynValue v = null;

if (obj is Type type)
v = UserData.CreateStatic(type);

// unregistered enums go as integers
if (obj is Enum)
// ReSharper disable once PossibleInvalidCastException
return DynValue.NewNumber((int)obj);

if (v != null) return v;

if (obj is Delegate @delegate)
return DynValue.NewCallback(CallbackFunction.FromDelegate(script, @delegate));

if (obj is MethodInfo { IsStatic: true } mi)
{
return DynValue.NewCallback(CallbackFunction.FromMethodInfo(script, mi));
}

if (obj is IList list)
{
var converted = new DynValue[list.Count];
for (var i = 0; i < list.Count; i++)
{
var o = list[i];
converted[i] = o.ToDynValue(script);
}

return DynValue.NewTable(script, converted);
}

var enumerator = ClrToScriptConversions.EnumerationToDynValue(script, obj);
if (enumerator != null) return enumerator;

return DynValue.FromObject(script, obj);
}

public static IntPtr Addr(this object obj)
{
var tr = __makeref(obj);
unsafe
{
#pragma warning disable CS8500
var ptr = *(IntPtr*)(&tr);
#pragma warning restore CS8500
return ptr;
}
}
}
2 changes: 1 addition & 1 deletion UniTAS/Patcher/Extensions/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static class TypeExtensions
{
public static string SaneFullName(this Type type)
{
if (type == null) throw new ArgumentNullException(nameof(type));
if (type == null) return "null";

var name = type.Name;
if (type.IsGenericParameter) return name;
Expand Down
19 changes: 9 additions & 10 deletions UniTAS/Patcher/Implementations/Coroutine/WaitForCoroutine.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
using System.Collections.Generic;
using UniTAS.Patcher.Interfaces.Coroutine;
using UniTAS.Patcher.Services;
using UniTAS.Patcher.Services.Logging;

namespace UniTAS.Patcher.Implementations.Coroutine;

public class WaitForCoroutine : CoroutineWait
public class WaitForCoroutine(IEnumerable<CoroutineWait> coroutineMethod) : CoroutineWait
{
private readonly IEnumerable<CoroutineWait> _coroutineMethod;

public WaitForCoroutine(IEnumerable<CoroutineWait> coroutineMethod)
{
_coroutineMethod = coroutineMethod;
}

protected override void HandleWait()
{
var coroutineStatus = Container.GetInstance<ICoroutine>().Start(_coroutineMethod);
coroutineStatus.OnComplete += _ => RunNext();
var coroutineStatus = Container.GetInstance<ICoroutine>().Start(coroutineMethod);
coroutineStatus.OnComplete += status =>
{
if (status.Exception != null)
Container.GetInstance<ILogger>().LogFatal($"coroutine exception: {status.Exception}");
RunNext();
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ private void FrameAdvanceUpdate(bool update)
// do we have new frame advance to do? don't bother pausing then
if (_pendingPauseFrames != 0) return;

_coroutine.Start(Pause(update));
_coroutine.Start(Pause(update)).OnComplete += status =>
{
if (status.Exception != null)
_logger.LogFatal($"exception occurs during frame advance coroutine: {status.Exception}");
};
}

private void CheckAndAddPendingFrameAdvances()
Expand Down Expand Up @@ -297,4 +301,4 @@ private void UpdateOffsetSyncFix()
_logger.LogDebug("fixed update offset");
PauseActual();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public class ObjectTrackerInstanceWindow : Window

private readonly IConfig _config;
private readonly IToolBar _toolBar;
private readonly ISceneWrapper _sceneWrapper;
private readonly ISceneManagerWrapper _iSceneManagerWrapper;
private readonly IWindowFactory _windowFactory;

public ObjectTrackerInstanceWindow(WindowDependencies windowDependencies,
UnityObjectIdentifier identifier,
IOnSceneLoadEvent onSceneLoadEvent, ISceneWrapper sceneWrapper, IWindowFactory windowFactory) : base(
IOnSceneLoadEvent onSceneLoadEvent, ISceneManagerWrapper iSceneManagerWrapper, IWindowFactory windowFactory) : base(
windowDependencies,
new WindowConfig(defaultWindowRect: GUIUtils.WindowRect(200, 200), showByDefault: true,
removeConfigOnClose: true),
Expand All @@ -39,7 +39,7 @@ public ObjectTrackerInstanceWindow(WindowDependencies windowDependencies,
_config = windowDependencies.Config;
_toolBar = windowDependencies.ToolBar;
_unityObjectIdentifier = identifier;
_sceneWrapper = sceneWrapper;
_iSceneManagerWrapper = iSceneManagerWrapper;
_windowFactory = windowFactory;
onSceneLoadEvent.OnSceneLoadEvent += UpdateInstance;
windowDependencies.UpdateEvents.OnLateUpdateActual += OnLateUpdateActual;
Expand Down Expand Up @@ -94,7 +94,7 @@ private void UpdateInstance()

if (_instance == null)
{
_instance = _unityObjectIdentifier.FindObject(_trackSettings.ObjectSearch, _sceneWrapper, TrackedObjects);
_instance = _unityObjectIdentifier.FindObject(_trackSettings.ObjectSearch, _iSceneManagerWrapper, TrackedObjects);
updateComponents = true;
}

Expand Down
Loading
Loading