コード例 #1
0
        public static T CreateComponent <T>() where T : Component
        {
            ulong id        = IdPool.Get();
            T     component = Activator.CreateInstance <T>();

            component.Id = id;

            // add component to Engine
            components[id] = component;

            return(component);
        }
コード例 #2
0
        public static GameObject CreateGameObject()
        {
            ulong      id      = IdPool.Get();
            GameObject @object = new GameObject();

            @object.Id = id;

            // add object to Engine
            objects[id] = @object;

            return(@object);
        }