Search Unity

Choosing a style of output for various system

Discussion in 'Entity Component System' started by franky_U, Jun 14, 2019.

  1. franky_U

    franky_U

    Joined:
    Mar 13, 2019
    Posts:
    12
    i am looking for a solution of a problem using ECS.I want to create an independent system which helps me to create lines an runtime when required by various other systems.So for that i am creating a DataComponent which has all the atttributes such as color, starting point and endpoint.

    Now i also want to introduce styles for the LinesDraw as well.For Ex- Dotted , Jazzy , shape etc.
    Currently I am using hybrid approach for work.One solution i came across is to define individual Component data per Style.
    For -Ex-
    1. public struct MyStyleA : IComponentData {}
    2. public struct MyStyleB : IComponentData {}
    3. public struct MyStyleC : IComponentData {}

    4. [...]
    and then using that per style component data in other system.

    or i can create per style IsharedComponentData per new entity created with LineData..

    What could be the best approach.Or is there any proper solution working with ECS for the describes situation.?

    Thanks