From e5be07ff96cc6a6bef3fc55c93341d06e1645219 Mon Sep 17 00:00:00 2001 From: Pixeye <19838200+PixeyeHQ@users.noreply.github.com> Date: Sun, 5 Jul 2020 20:49:21 +0200 Subject: [PATCH] Resolved #61 --- Runtime/Core/Layer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Runtime/Core/Layer.cs b/Runtime/Core/Layer.cs index 98d9a467..7558b0d2 100644 --- a/Runtime/Core/Layer.cs +++ b/Runtime/Core/Layer.cs @@ -117,6 +117,14 @@ public Buffer GetBuffer() where Y : struct return Buffer.layers[id]; } + public Y Add() 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