Search Unity

Get list of scriptable objects in JobComponentSystem

Discussion in 'Entity Component System' started by JamesWjRose, Oct 18, 2019.

  1. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I am using EasyRoads3D (great asset, terrific support) and it's data (lanes, points, etc) Because the Road object cannot be a iComponentData (drats) I have a list of Scriptable objects that hold the Road, lane, Car-identity and vector3 points along the road.

    What I have right now is a MonoBehavior that when it starts, loads a collection of cars and saves an ScriptableObject (AutoRoad: CarIdent, ERRoad, Lane, Points) into another ScriptableObject that is a list of the AutoRoad (AutoRoads)

    When running the job I need access to this list so that when the Car gets to the next point, I need to query this list to get the road data.

    So, I need to be able to get this list. I can't add a SerializedField to the job (drats again) and I don't know the best way to get this list, OR if there is another way to get what I need. I'm open to another method.

    Thanks