Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

ECS Angry Bots sample update or alternative?

Discussion in 'Entity Component System' started by timothy_j, Jun 6, 2020.

  1. timothy_j

    timothy_j

    Joined:
    Apr 11, 2020
    Posts:
    12
    I'm looking for a simple but 'complete' hybrid DOTS example to get my head round some real world hybrid basics. ECS Angry Bots looks perfect - except for the fact that it is somewhat out of date.

    It would be great if someone could link to a more up-to-date hybrid sample...

    ...or help me get it to run on the latest DOTS packages?

    In terms of updating Angry Bots, I haven't managed to get rid of all the compiler errors yet (using Unity 19.3, Entities 0.11 and related dependencies). So far I've tried:
    • World.Active replaced by World.DefaultGameObjectInjectionWorld (or just World where this is available as a property)
    • Time.deltaTime replaced by Time.DeltaTime
    I'm not sure how best to replace:
    • IJobForEachWithEntity<> (e.g. in TimedDestroySystem)
    • The second parameter of GameObjectConversionUtility.ConvertGameObjectHierarchy (e.g. in EnemySpawner)
    I could probably manage to update inheritance from ComponentSystem to SystemBase etc. as long as I could get it to run in its current form first!
     
  2. timothy_j

    timothy_j

    Joined:
    Apr 11, 2020
    Posts:
    12
    Got it to run with the edits mentioned above and using
    GameObjectConversionUtility.ConvertGameObjectHierarchy(bulletPrefab, new GameObjectConversionSettings(World.DefaultGameObjectInjectionWorld, GameObjectConversionUtility.ConversionFlags.AddEntityGUID))
    for each of the
    GameObjectConversionUtility.ConvertGameObjectHierarchy
    calls.
     
  3. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    677
    IJobForEachWithEntity should be replaced with Entities.ForEach for now.