Repository navigation
Expand file tree
/
Copy pathCanvasRenderer.cs
More file actions
106 lines (106 loc) · 3.03 KB
/
Copy pathCanvasRenderer.cs
File metadata and controls
106 lines (106 loc) · 3.03 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace UnityEngine
{
public sealed class CanvasRenderer : Component
{
public delegate void OnRequestRebuild();
public static event CanvasRenderer.OnRequestRebuild onRequestRebuild
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
CanvasRenderer.onRequestRebuild = (CanvasRenderer.OnRequestRebuild)Delegate.Combine(CanvasRenderer.onRequestRebuild, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
CanvasRenderer.onRequestRebuild = (CanvasRenderer.OnRequestRebuild)Delegate.Remove(CanvasRenderer.onRequestRebuild, value);
}
}
public extern bool isMask
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern int relativeDepth
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern int absoluteDepth
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public void SetColor(Color color)
{
CanvasRenderer.INTERNAL_CALL_SetColor(this, ref color);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_SetColor(CanvasRenderer self, ref Color color);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Color GetColor();
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern float GetAlpha();
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void SetAlpha(float alpha);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void SetMaterial(Material material, Texture texture);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Material GetMaterial();
public void SetVertices(List<UIVertex> vertices)
{
if (vertices.Count > 65535)
{
Debug.LogWarning(UnityString.Format("Number of vertices set exceeds {0}, rendering of this element will be skipped", new object[]
{
65535
}), this);
vertices.Clear();
}
this.SetVerticesInternal(vertices);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SetVerticesInternal(object vertices);
public void SetVertices(UIVertex[] vertices, int size)
{
if (size > 65535)
{
Debug.LogWarning(UnityString.Format("Number of vertices set exceeds {0}, rendering of this element will be skipped", new object[]
{
65535
}), this);
size = 0;
}
this.SetVerticesInternalArray(vertices, size);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SetVerticesInternalArray(UIVertex[] vertices, int size);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void Clear();
private static void RequestRefresh()
{
if (CanvasRenderer.onRequestRebuild != null)
{
CanvasRenderer.onRequestRebuild();
}
}
}
}