We gave three developers the keys to our Digital Twin Twitter account so they could share some tips and tricks they have learned while working in Unity. Here is what each of these brilliant individuals covered.
1. You can use lambda functions to connect UnityEvents to functions that have incompatible signatures
2. The [ContextMenu(“”)] attribute allows you to call a function from any instance of that component in the editor
3. You can replicate the legacy Input method of detecting a keypress with this snippet for the new InputSystem
4. ScriptableObjects have become one of my favorite workflows but they are unable to reference objects in your scene
5. If you format the names of your layers, tags, and more like filepaths Unity’s UI will automatically create sub menus to better organize your projects for you