public void Initialize(int portNodeId, NodeGraph portGraph)
        {
            this.nodeId = portNodeId;
            this.graph  = portGraph;

            connections ??= new List <PortConnection>();
            connections.ForEach(x => x.Initialize(portGraph));

            //initialize port lifetime
            lifeTimeDefinition ??= new LifeTimeDefinition();
            lifeTime = lifeTimeDefinition.LifeTime;
            lifeTimeDefinition.Release();

            //initialize port value
            portValue.Initialize(fieldName);
            //bind port value to port lifetime
            lifeTime.AddDispose(portValue);
        }
        public void Initialize(INode data)
        {
            this.node   = data;
            this.nodeId = data.Id;

            connections = connections ?? new List <PortConnection>();
            connections.ForEach(x => x.Initialize(node.GraphData));

            //initialize port lifetime
            lifeTimeDefinition = lifeTimeDefinition ?? new LifeTimeDefinition();
            lifeTime           = lifeTimeDefinition.LifeTime;
            lifeTimeDefinition.Release();

            //initialize port value
            portValue.Initialize(fieldName);
            //bind port value to port lifetime
            lifeTime.AddDispose(portValue);
        }
        private EcsWorld ActivateWorld(ILifeTime lifeTime)
        {
            if (_world != null)
            {
                return(_world);
            }

            var world = CreateWorld();

            world.InitializeWorld();

            var destroyAction = ClassPool.Spawn <DisposableAction>();

            destroyAction.Initialize(world.Destroy);

            lifeTime.AddDispose(destroyAction);

            return(world);
        }