Exemple #1
0
    public static int ToLayerMask(this ELayers layers)
    {
        int mask = 0;

        if ((layers & ELayers.Default) != 0)
        {
            mask |= DefaultMask;
        }
        if ((layers & ELayers.TransparentFX) != 0)
        {
            mask |= TransparentFXMask;
        }
        if ((layers & ELayers.Water) != 0)
        {
            mask |= WaterMask;
        }
        if ((layers & ELayers.UI) != 0)
        {
            mask |= UIMask;
        }
        if ((layers & ELayers.Terrain) != 0)
        {
            mask |= TerrainMask;
        }
        if ((layers & ELayers.Pickups) != 0)
        {
            mask |= PickupsMask;
        }
        if ((layers & ELayers.NoCollision) != 0)
        {
            mask |= NoCollisionMask;
        }
        if ((layers & ELayers.Trigger) != 0)
        {
            mask |= TriggerMask;
        }
        if ((layers & ELayers.HitTest) != 0)
        {
            mask |= HitTestMask;
        }
        if ((layers & ELayers.Trees) != 0)
        {
            return(mask |= TreesMask);
        }

        return(mask);
    }
Exemple #2
0
 private Canvas GetLayer(ELayers l)
 {
     return(_layers[(int)l]);
 }