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

Set a layer as "built-in"

Discussion in 'Scripting' started by KMacro, Jan 19, 2019.

  1. KMacro

    KMacro

    Joined:
    Jan 7, 2019
    Posts:
    48
    I am working on a project that will be used as the basis for other projects in the future. I want to define some custom layers, and if possible set it so those layers cannot be edited so they will always be present in every iteration of my project. Unity contains the functionality to have "un-editable" layers as seen in its built-in layers (Default, TransparentFX, etc.), but is there any way for a user to set their own custom layers to a similar state?
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,513
    not really

    technically you could probably write a new editor for the layer stuff and block it out... but that's a lot of work for something like that.

    Another is to just write some kind of editor script that monitors the layers and pops up a warning/yell message that scolds people if they change a layer.

    In the end though... it's your project. Just establish a rule in the team that you don't edit those layers.
     
    SparrowGS likes this.
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    You could also just make a template project to avoid the hassle of doing all the setup every time.
     
  4. KMacro

    KMacro

    Joined:
    Jan 7, 2019
    Posts:
    48
    Thanks for the suggestions. I understand that we can just establish a convention, but the project will be passing through many hands, so I was just wondering if there was a way to make it 100% foolproof.