Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Should i Package Utility Script

Discussion in 'Package Manager' started by as3mbus, Apr 6, 2020.

  1. as3mbus

    as3mbus

    Joined:
    Dec 5, 2016
    Posts:
    71
    I am used to making multiple extension script that i would move out across project for it's usefulness. but i'm debating myself whether i should make a separate package for those utilities script or just keep it as is.

    now i am faced with a condition where one of my package is dependent on one of it's function / class that only serve ~ 5 line. is there any way for me to solve this kind of dilemma

    and availablity of version defines in unity 2018 screwed me when trying to introduce UPM to my work place

    feel free to ask for more detail if it's not clear enough
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Well there're two things here. One is the scale to package things up (editor time). Another is to strip unnecessary code for build (runtime). The first is what developer should care about, the second is what Unity should care about via code stripping.

    For the first, I suggest have a look at how starikcetin organize his useful codes. https://openupm.com/packages/com.eflatun.common/, scroll to the right bottom to see the "Related packages" section.
     
  3. as3mbus

    as3mbus

    Joined:
    Dec 5, 2016
    Posts:
    71
    so the only solution is dividing my utilities into smaller packages and actually utilizing dependencies.

    i was wondering if there a way to not include a folder. like an optional folder that only get included if the optional dependency is present

    found out a thread which might related to this (bumped the thread as well with the question)

    https://forum.unity.com/threads/optional-package-dependencis.719321/

    but it doesn't mention about optional folder / assembly definition