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

Disable assembly from getting loaded / built in other Unity projects

Discussion in 'Scripting' started by CraftedGaming, Mar 17, 2021.

  1. CraftedGaming

    CraftedGaming

    Joined:
    Jun 9, 2017
    Posts:
    37
    I intend to prevent my assembly from getting built into other unity projects that I do not handle. I was wondering if there's a way to do it without Unity editor like in the assembly itself?

    I'm not sure where to place this thread. I figured scripting would be more appropriate.
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    Not likely doable, .NET code is inherently transparent because of the way it's compiled to CIL. You could perhaps add code to evaluate what assembly it's being used from in your most significant functions, but that would come at massive runtime performance issues in your own projects. Reflection can always peek around too.

    What exactly are you trying to accomplish?
     
  3. CraftedGaming

    CraftedGaming

    Joined:
    Jun 9, 2017
    Posts:
    37
    I simply want to prevent their build from running if it's not part of ours (our company). As of right now, I simply check if the company name is under a specified name at the start. I only call it once in several of my major classes. So far, it's working fine on my end. Just wondering if there's a better option.

    I'll take note of the transparency part. thanks
     
    Last edited: Mar 18, 2021