示例#1
0
 private void OnValidate()
 {
     if (worldEntityManager != null && World.DefaultGameObjectInjectionWorld != null)
     {
         ContainedDestroySystem containedDestroySystemSystem = World.DefaultGameObjectInjectionWorld.GetExistingSystem <ContainedDestroySystem>();
         if (containedDestroySystemSystem != null)
         {
             containedDestroySystemSystem.WorldLimits = worldLimits;
         }
     }
 }
示例#2
0
    private void Start()
    {
        blobAssetStore = new BlobAssetStore();
        // Get ECS representation
        var settings = GameObjectConversionSettings.FromWorld(World.DefaultGameObjectInjectionWorld, blobAssetStore);

        bulletPrefabEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(bulletPrefab, settings);
        // Get Current ECS manager
        worldEntityManager = World.DefaultGameObjectInjectionWorld.EntityManager;

        ContainedDestroySystem containedDestroySystemSystem = World.DefaultGameObjectInjectionWorld.GetOrCreateSystem <ContainedDestroySystem>();

        containedDestroySystemSystem.WorldLimits = worldLimits; // Set up world limits
    }