forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathITilemap.cs
More file actions
79 lines (65 loc) · 2.06 KB
/
Copy pathITilemap.cs
File metadata and controls
79 lines (65 loc) · 2.06 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using UnityEngine.Scripting;
namespace UnityEngine.Tilemaps
{
[RequiredByNativeCode]
public class ITilemap
{
internal static ITilemap s_Instance;
internal Tilemap m_Tilemap;
internal ITilemap()
{
}
internal void SetTilemapInstance(Tilemap tilemap)
{
m_Tilemap = tilemap;
}
// Tilemap
public Vector3Int origin { get { return m_Tilemap.origin; } }
public Vector3Int size { get { return m_Tilemap.size; } }
public Bounds localBounds { get { return m_Tilemap.localBounds; } }
public BoundsInt cellBounds { get { return m_Tilemap.cellBounds; } }
// Tile
public virtual Sprite GetSprite(Vector3Int position)
{
return m_Tilemap.GetSprite(position);
}
public virtual Color GetColor(Vector3Int position)
{
return m_Tilemap.GetColor(position);
}
public virtual Matrix4x4 GetTransformMatrix(Vector3Int position)
{
return m_Tilemap.GetTransformMatrix(position);
}
public virtual TileFlags GetTileFlags(Vector3Int position)
{
return m_Tilemap.GetTileFlags(position);
}
// Tile Assets
public virtual TileBase GetTile(Vector3Int position)
{
return m_Tilemap.GetTile(position);
}
public virtual T GetTile<T>(Vector3Int position) where T : TileBase
{
return m_Tilemap.GetTile<T>(position);
}
public void RefreshTile(Vector3Int position)
{
m_Tilemap.RefreshTile(position);
}
public T GetComponent<T>()
{
return m_Tilemap.GetComponent<T>();
}
[RequiredByNativeCode]
private static ITilemap CreateInstance()
{
s_Instance = new ITilemap();
return s_Instance;
}
}
}