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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

ECS compiler define

Discussion in 'Entity Component System' started by LennartJohansen, Mar 20, 2018.

  1. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    is there some kind compiler define set if the ECS is installed?

    Lennart
     
    antoripa and one_one like this.
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Unfortunately there is no compiler define set if ECS is installed. I do agree that we need to find a good solution for that though.
     
    antoripa likes this.
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. Then we can give a warning about code needing it and not compiler errors.

    Lennart
     
  4. Fydar

    Fydar

    Joined:
    Feb 23, 2014
    Posts:
    70
    I believe that Unity should definitely expose a lot more information in defines, and allow for global definitions to be done through an asset. This would allow Asset Store Publishers (like myself) to inform the user properly if any issues are occurring.

    It would also allow the Asset Store publishers to optimize their assets and utilise other Assets optionally.

    There is a file that Unity will utilise to provide global defines, however this only works when placed in a single static directory in the asset, and doesn't allow multiple of them.

    I have an asset which may conflict with another asset from the Asset Store when installing with each other. If the other asset could simply provide a Define then I can get around this issue easily.
     
  5. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Interesting to see this. This seems to be a problem for many years, not just ECS. I looked a little bit into this 2 years ago:
    https://forum.unity.com/threads/check-if-devs-has-assets.388182

    There is possible to trace during Editor Update if developer install particular asset by checking for class name.

    But there is a problem that if developer is deleting asset or renaming class, it needs to un-define it. I think MapMagic has some kind of deletion handling, i.e. it sets scripting define symbols on install and unsets symbols on removal.

    Just thought that it would be neat if such procedures would be automatically handled with the new Package Manager, i.e. when user installs a package, define would be added (i.e. define symbols automatically used from package title). And when uninstalls, define removed.
     
  6. Fydar

    Fydar

    Joined:
    Feb 23, 2014
    Posts:
    70
    The new "Package Manager" Unity has specifically said was for Unity extensions only, so I doubt that this would be implemented in the Package Manager, however, Unity might find an Asset-based "define" solution would be a good way to deliver defines for a "package" and thus giving us the freedom to implement this ourselves.

    On a side note, if you want cross-asset compatibility, use partial classes, however, this requires changes on both assets to allow this to work.