Skip to content

Commit

Permalink
Resolved #61
Browse files Browse the repository at this point in the history
  • Loading branch information
PixeyeHQ committed Jul 5, 2020
1 parent 0fdb08e commit e5be07f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Runtime/Core/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ public Buffer<Y> GetBuffer<Y>() where Y : struct
return Buffer<Y>.layers[id];
}

public Y Add<Y>() where Y : new()
{
var obj = new Y();
if (obj is IRequireActorsLayer member)
member.Bootstrap(this);
objects.Add(typeof(Y).GetHashCode(), obj);
return obj;
}

#region SIGNALS

Expand Down

0 comments on commit e5be07f

Please sign in to comment.