示例#1
0
        private void Start()
        {
            var world = WorldHandler.GetWorld();

            if (world != null && !isProccessed)
            {
                var instantiateEntity    = world.NewEntity();
                var instantiateComponent = new InstantiateComponent()
                {
                    gameObject = gameObject
                };
                instantiateEntity.Replace(instantiateComponent);
            }
        }
示例#2
0
        public void PreInit()
        {
            var convertableGameObjects =
                GameObject.FindObjectsOfType <ConvertToEntity>();

            // Iterate throught all gameobjects, that has ECS Components
            foreach (var convertable in convertableGameObjects)
            {
                AddEntity(convertable.gameObject);
            }

            // After adding all entitites from the begining of the scene, we need to handle global World value
            WorldHandler.Init(_world);
        }