Skip to content

Commit

Permalink
Merge pull request #23 from mewlist/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
mewlist authored Feb 17, 2024
2 parents 6ad51a4 + 80cd840 commit f785cfc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Runtime/Helpers/UnityObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ public static object InstantiateComponentInSceneRoot(Type targetType, Scene scen

var go = new GameObject(targetType.Name);
var instance = go.AddComponent(targetType);

using var instanceIds = new NativeArray<int>( new [] { instance.gameObject.GetInstanceID() }, Allocator.Temp);
SceneManager.MoveGameObjectsToScene(instanceIds, scene);

SceneManager.MoveGameObjectToScene(instance.gameObject, scene);
return instance;
}

Expand Down

0 comments on commit f785cfc

Please sign in to comment.