Search Unity

Adding external project to the solution

Discussion in 'Scripting' started by OctoSharko, Jul 27, 2017.

  1. OctoSharko

    OctoSharko

    Joined:
    Dec 9, 2016
    Posts:
    35
    Hi,

    I am trying to add an external project to my unity solution.
    It works fine using mono develop but whenever I switch back to unity it seems to remove the reference from the solution.

    Is there a way to prevent unity from doing this ?

    Thanks,
     
  2. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    No, Unity rebuilds the project files regularly.

    I believe the best method is to compile your external project separately and copy the .dll into Assets\Plugins in your Unity project. Unity will then be able to reference your dll. You can set up a post build process in your external project to automatically copy the dll.
     
  3. OctoSharko

    OctoSharko

    Joined:
    Dec 9, 2016
    Posts:
    35
    Thanks,

    Not ideal at all :( whenever I want to modify the external project, I need to rebuild it then.

    Not ideal indeed !
     
  4. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    Is there a reason it needs to be external? You can also just put the code into the Plugins folder and Unity will put it in a separate project within the solution that will be compiled first.
     
  5. OctoSharko

    OctoSharko

    Joined:
    Dec 9, 2016
    Posts:
    35
    Hi Dave,

    Because the code contains, for example, business objects and some logic that is shared with the server of my 3 tiers app.

    It is very common to have shared/common project under source control that is shared by both the client and server of an application.

    Placing the code under the Unity Plugin folder breaks basic architectural concepts.

    But since I don't have a choice, I'll probably do that.

    Thanks