Last active
November 13, 2023 19:42
-
-
Save unitycoder/879f4b676964345ab548 to your computer and use it in GitHub Desktop.
Get Layernumber from Layermask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public LayerMask yourLayer = 1 << 10; // 10 | |
gameObject.layer = (int)Mathf.Log(yourLayer.value, 2); |
Check if Layer Exists (by name), Assign Gameobject to layer using LayerMask
https://gist.github.com/unitycoder/65f604895f1699b92af1ba7762bfab45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LayerMask set initial value to "Default" or "Everything" or multiple layers
https://gist.github.com/unitycoder/17b82701f3e2f187eff9