Open NumidWasNotAvailable opened 1 year ago
I implemented this in my LayerMask branch with [Layer(mask=true)]
or [SortingLayer(mask=true)]
. There is also a [XRILayer(mask=true)]
for the XR Interaction Toolkit in the LayerMaskXRI branch.
It should also be easy to add new LayerMask types, you just have to subclass BaseLayerAttribute and provide correct implementations for:
string[] GetLayers();
int NameToLayer(string layerName);
string LayerToName(int layer);
Might make a pull request later, but it doesn't look like the owner is active anymore...
So why not just:
public LayerMask myLayerMask;
this value can also be directly used as raycast parameter.
LayerMaskAttribute
would decorateint
fields, with the ability to generate a layer mask. The value could be used for raycasting, for instance.This would look like
EnumFlagsAttribute
, applied to the layers logic.What do you think about it?
Again, I can propose an implementation.