Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 3 deletions src/Arch/Core/Events/World.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ public void OnComponentAdded(Entity entity, ComponentType compType)
/// Calls all handlers subscribed to component setting of this type.
/// </summary>
/// <param name="entity">The entity that the component was set on.</param>
/// <param name="comp">The component instance that got set.</param>
/// <param name="compType">The type of component that got set.</param>

public void OnComponentSet(Entity entity, object comp)
public void OnComponentSet(Entity entity, ComponentType compType)
{
#if EVENTS
var events = GetEvents(comp.GetType());
var events = GetEvents(compType);
if (events == null)
{
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Arch/Core/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ public void Set(Entity entity, object component)
{
var entitySlot = EntityInfo.GetEntityData(entity.Id);
entitySlot.Archetype.Set(ref entitySlot.Slot, component);
OnComponentSet(entity, component);
OnComponentSet(entity, (ComponentType)component.GetType());
}

/// <summary>
Expand All @@ -1311,7 +1311,7 @@ public void SetRange(Entity entity, Span<object> components)
foreach (var cmp in components)
{
entitySlot.Archetype.Set(ref entitySlot.Slot, cmp);
OnComponentSet(entity, cmp);
OnComponentSet(entity, (ComponentType)cmp.GetType());
}
}

Expand Down
Loading