Skip to content

Commit f8abe34

Browse files
[Core] Fix previous commit's compilation errors;
1 parent cbd81a2 commit f8abe34

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

Engine/Core/Entities/EntityCallback.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ internal void UpdateCache()
113113

114114
var type = TypeCache.GetType(callback.className);
115115

116-
if (type == null || entity.TryGetComponent(out _, type) == false)
116+
if (type == null || entity.TryGetComponent(type, out _) == false)
117117
{
118118
persistentCache.Add(null);
119119

@@ -156,7 +156,7 @@ public void Invoke()
156156
foreach(var callback in persistentCache)
157157
{
158158
if(callback == null ||
159-
callback.entity.TryGetComponent(out var component, callback.type) == false)
159+
callback.entity.TryGetComponent(callback.type, out var component) == false)
160160
{
161161
continue;
162162
}
@@ -276,7 +276,7 @@ internal void UpdateCache()
276276

277277
var type = TypeCache.GetType(callback.className);
278278

279-
if (type == null || entity.TryGetComponent(out _, type) == false)
279+
if (type == null || entity.TryGetComponent(type, out _) == false)
280280
{
281281
persistentCache.Add(null);
282282

@@ -330,7 +330,7 @@ public void Invoke(T value)
330330
foreach (var callback in persistentCache)
331331
{
332332
if (callback == null ||
333-
callback.entity.TryGetComponent(out var component, callback.type) == false)
333+
callback.entity.TryGetComponent(callback.type, out var component) == false)
334334
{
335335
continue;
336336
}
@@ -450,7 +450,7 @@ internal void UpdateCache()
450450

451451
var type = TypeCache.GetType(callback.className);
452452

453-
if (type == null || entity.TryGetComponent(out _, type) == false)
453+
if (type == null || entity.TryGetComponent(type, out _) == false)
454454
{
455455
persistentCache.Add(null);
456456

@@ -506,7 +506,7 @@ public void Invoke(T A, T2 B)
506506
foreach (var callback in persistentCache)
507507
{
508508
if (callback == null ||
509-
callback.entity.TryGetComponent(out var component, callback.type) == false)
509+
callback.entity.TryGetComponent(callback.type, out var component) == false)
510510
{
511511
continue;
512512
}

Engine/Core/Rendering/RenderSystem/RenderSystem+Internal.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public void WorldChanged()
231231

232232
foreach (var system in renderSystems)
233233
{
234-
if (entityInfo.Item1.TryGetComponent(out var component, system.RelatedComponent()))
234+
if (entityInfo.Item1.TryGetComponent(system.RelatedComponent(), out var component))
235235
{
236236
if(collected.TryGetValue(system, out var content) == false)
237237
{
@@ -363,7 +363,7 @@ void Handle(Entity e, Transform t)
363363
foreach (var system in systems)
364364
{
365365
if (system.RelatedComponent() != null &&
366-
e.TryGetComponent(out var related, system.RelatedComponent()))
366+
e.TryGetComponent(system.RelatedComponent(), out var related))
367367
{
368368
system.Preprocess([(e, t, related)], camera, cameraTransform);
369369

Engine/Core/Resources/ResourceManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public Scene LoadRawSceneFromPath(string path)
660660
var componentType = TypeCache.GetType(component.type);
661661

662662
if(componentType == null ||
663-
entity.TryGetComponent(out var componentInstance, componentType) == false)
663+
entity.TryGetComponent(componentType, out var componentInstance) == false)
664664
{
665665
continue;
666666
}
@@ -707,7 +707,7 @@ public Scene LoadRawSceneFromPath(string path)
707707
var targetEntity = Scene.FindEntity(entityID);
708708

709709
if (targetEntity.IsValid == false ||
710-
targetEntity.TryGetComponent(out var targetComponent, targetComponentType) == false)
710+
targetEntity.TryGetComponent(targetComponentType, out var targetComponent) == false)
711711
{
712712
continue;
713713
}
@@ -831,7 +831,7 @@ public Scene LoadSceneFromGuid(string guid)
831831
var componentType = TypeCache.GetType(component.type);
832832

833833
if (componentType == null ||
834-
entity.TryGetComponent(out var componentInstance, componentType) == false)
834+
entity.TryGetComponent(componentType, out var componentInstance) == false)
835835
{
836836
continue;
837837
}
@@ -876,7 +876,7 @@ public Scene LoadSceneFromGuid(string guid)
876876
var targetEntity = Scene.FindEntity(entityID);
877877

878878
if (targetEntity.IsValid == false ||
879-
targetEntity.TryGetComponent(out var targetComponent, targetComponentType) == false)
879+
targetEntity.TryGetComponent(targetComponentType, out var targetComponent) == false)
880880
{
881881
continue;
882882
}

Engine/Core/Serialization/Scene/SceneSerialization.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ void HandleReferences(Entity entity, SceneObject sceneObject)
434434
{
435435
var componentType = TypeCache.GetType(component.type);
436436

437-
if(componentType == null || entity.TryGetComponent(out var componentInstance, componentType) == false)
437+
if(componentType == null || entity.TryGetComponent(componentType, out var componentInstance) == false)
438438
{
439439
continue;
440440
}
@@ -489,7 +489,7 @@ void HandleReferences(Entity entity, SceneObject sceneObject)
489489
}
490490

491491
if(targetEntity.IsValid == false ||
492-
targetEntity.TryGetComponent(out var targetComponent, targetComponentType) == false)
492+
targetEntity.TryGetComponent(targetComponentType, out var targetComponent) == false)
493493
{
494494
continue;
495495
}

Engine/Core/World/World+Iteration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public bool TryFindEntityComponent(string name, bool allowDisabled, Type compone
530530
{
531531
var e = FindEntity(name, allowDisabled);
532532

533-
return TryGetComponent(e, out component, componentType);
533+
return TryGetComponent(e, componentType, out component);
534534
}
535535

536536
/// <summary>

Engine/Editor/Editors/EditorGUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ public static void DragDropTarget(Type type, Action<object> callback)
11621162
unsafe
11631163
{
11641164
if (payload.Handle != null && StapleEditor.instance.draggedEntity.IsValid &&
1165-
StapleEditor.instance.draggedEntity.TryGetComponent(out var component, type))
1165+
StapleEditor.instance.draggedEntity.TryGetComponent(type, out var component))
11661166
{
11671167
StapleEditor.instance.draggedEntity = default;
11681168

0 commit comments

Comments
 (0)