forked from bbepis/XUnity.AutoTranslator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayerMask.cs
More file actions
65 lines (56 loc) · 1.33 KB
/
LayerMask.cs
File metadata and controls
65 lines (56 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
namespace UnityEngine
{
public struct LayerMask
{
private int m_Mask;
public int value
{
get
{
return m_Mask;
}
set
{
m_Mask = value;
}
}
public static implicit operator int( LayerMask mask )
{
return mask.m_Mask;
}
public static implicit operator LayerMask( int intVal )
{
LayerMask result = default( LayerMask );
result.m_Mask = intVal;
return result;
}
public static extern string LayerToName( int layer );
public static extern int NameToLayer( string layerName );
public static int GetMask( params string[] layerNames )
{
if( layerNames == null )
{
throw new ArgumentNullException( "layerNames" );
}
int num = 0;
foreach( string layerName in layerNames )
{
int num2 = NameToLayer( layerName );
if( num2 != -1 )
{
num |= 1 << num2;
}
}
return num;
}
}
}