Skip to content

Commit

Permalink
Fixed #62
Browse files Browse the repository at this point in the history
  • Loading branch information
PixeyeHQ committed Jul 6, 2020
1 parent e5be07f commit aaa4f93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Runtime/LibEcs/GroupCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public abstract class GroupCore : IEnumerable, IEquatable<GroupCore>, IDisposabl
internal Layer layer;

#if ACTORS_EVENTS_MANUAL
public ents added;
public ents removed;
public ents added = new ents();
public ents removed = new ents();

internal bool hasEventAdd;
internal bool hasEventRemove;
Expand Down Expand Up @@ -89,15 +89,15 @@ internal void SetSelf(Op op, Processor pr)
if ((op & Op.Add) == Op.Add)
{
if (added == null)
added = new ents(Framework.Settings.SizeEntities);
added = new ents(LayerKernel.Settings.SizeEntities);

hasEventAdd = true;
}

if ((op & Op.Remove) == Op.Remove)
{
if (removed == null)
removed = new ents(Framework.Settings.SizeEntities);
removed = new ents(LayerKernel.Settings.SizeEntities);

hasEventRemove = true;
}
Expand Down
18 changes: 9 additions & 9 deletions Runtime/LibProcessors/ProcessorEcs.Handle.Groups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ internal void Add(object obj)
if (!myFieldInfo.FieldType.IsSubclassOf(groupType)) continue;

#if ACTORS_EVENTS_MANUAL
// in case we are looking at the group of the derived processor we want to check it's events
if (inner == null)
{
groupEv = Attribute.GetCustomAttribute(myFieldInfo, typeof(EventsAttribute)) as EventsAttribute;
}
// in case we are looking at the group of the derived processor we want to check it's events
// if (inner == null)
// {
groupEv = Attribute.GetCustomAttribute(myFieldInfo, typeof(EventsAttribute)) as EventsAttribute;
//}
#endif

var groupByAttribute = Attribute.GetCustomAttribute(myFieldInfo, typeof(GroupByAttribute)) as GroupByAttribute;
Expand Down Expand Up @@ -96,10 +96,10 @@ internal void Add(object obj)


#if ACTORS_EVENTS_MANUAL
if (groupEv != null)
{
group.SetSelf(groupEv.op, b as Processor);
}
if (groupEv != null)
{
group.SetSelf(groupEv.op, obj as Processor);
}
#endif
}
}
Expand Down

0 comments on commit aaa4f93

Please sign in to comment.