Search Unity

Is there an Ability to link to and import Scenes and assets from other projects?

Discussion in 'Editor & General Support' started by Arowx, Mar 9, 2021.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I just though it would be great to be able to link and import Scenes/Assets between projects.

    For instance:
    1. Options Menu systems.
    2. Game Studio Intros
    3. Credits
    4. Hi Score Tables
    5. ...
    Or other elements that could be used across platforms e.g. UI Overlays or Controls for common types of games.

    Would benefit multi-projects allowing updates to be made in one place and automatically incorporated into new builds across multiple projects.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    You can use git submodules to put an entire directory (underneath Assets) into its own git repository.

    Then your outer git repository (you ARE using source control, right???) would track what state the inner repository should be at.

    My company uses this mechanism at fairly large scale. Forensically the outer git module precisely and repeatably controls the position of the inner submodule to be able to instantly replicate any setup, as well as control the uptake of library (shared) features.

    If that's too much plumbing you can just link (
    ln
    ) directories in your filesystem, but that has the drawback that every game is instantaneously using only one version of every file, and you are not source controlled. All damage to shared files spreads instantly to all projects using it.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Personally, I think this is risky. Developers get tunnel vision when working on their project, and make changes which may unintentionally break how the same code is used in a different project. From a QA perspective, it also becomes a nightmare, because changes now need to be verified across all projects which use that shared code, instead of just the project the change was intended for.

    This also creates a problem when one project is getting close to release, you'll need to freeze any code shared between projects, which interrupts those other projects. In a project nearing release, you don't want to take any unnecessary changes.

    So I think it is better to manually merge changes to shared code. It is more work for the devs when merging, but it allows projects to not step on each other, it allows devs to focus on just their project instead of worrying about what their changes are going to break in any other project, and it lets QA focus on just verifying changes to the one project the change is intended for.
     
    Last edited: Mar 9, 2021
    Kurt-Dekker likes this.