Элемент, который может быть использован для рендеринга экрана.
Элементы на полотне (canvas), которые рендерятся после рендеринга сцены, либо от присоединенной камеры или с помощью режима наложения (overlay mode).
#pragma strict @script RequireComponent(Canvas) @script RequireComponent(UIRenderer)
var verts : UIVertex[];
function Start () { var canvas : Canvas = GetComponent ("Canvas"); canvas.renderMode = RenderMode.Overlay; verts = new UIVertex[4]; GenerateVerts(); }
function GenerateVerts() { GenerateSquare(); var uiRenderer : UIRenderer = GetComponent ("UIRenderer") ; uiRenderer.SetVertices (verts); var mat = Material (Shader.Find ("Sprites/Default")); uiRenderer.SetMaterial (mat, null); }
function GenerateSquare() { var vert : UIVertex; vert.color = Color32 (255, 0, 0, 255); vert.uv = Vector2 (0, 0); vert.position = Vector3 (0, 0); verts[0] = vert; vert.position = Vector3 (0, 300); verts[1] = vert; vert.position = Vector3 (300, 300); verts[2] = vert; vert.position = Vector3 (300, 0); verts[3] = vert; }
| cachedSortingLayerValue | Cached calculated value based upon SortingLayerID. |
| isRootCanvas | Это корень Canvas? |
| overridePixelPerfect | Используется с вложенными полотнами, позволяющими иметь разные настройки pixelPerfect в иерархии. |
| overrideSorting | Переопределяет сортировку на полотне (canvas). |
| pixelPerfect | Заставляет элементы на полотне прийти в соответствие с пикселями. Применяется только с RenderMode в экранном пространстве. |
| pixelRect | Get the render rect for the Canvas. |
| planeDistance | Как далеко от камеры полотно (Canvas) было сгенерировано. |
| referencePixelsPerUnit | Количество пикселей на единицу, которая считается по умолчанию. |
| renderMode | Этот Canvas в мировом режиме или режиме наложения? |
| renderOrder | Порядок рендеринга, в котором полотно отображается на сцене. |
| rootCanvas | Returns the Canvas closest to root, by checking through each parent and returning the last canvas found. If no other canvas is found then the canvas will return itself. |
| scaleFactor | Используется для масштабирования всего полотна, пока он располагается по размеру экрана. Применяется только с RenderMode в экранном пространстве. |
| sortingGridNormalizedSize | The normalized grid size that the canvas will split the renderable area into. |
| sortingLayerID | Идентификатор слоя сортировки полотна (Canvas). |
| sortingLayerName | Название слоя сортировки полотна (Canvas). |
| sortingOrder | Порядок полотна (Canvas) без слоя сортировки. |
| targetDisplay | For Overlay mode, display index on which the UI canvas will appear. |
| worldCamera | Camera used for sizing the Canvas when in Screen Space - Camera. Also used as the Camera that events will be sent through for a World Space [[Canvas]. |
| ForceUpdateCanvases | Заставляет все полотна (canvases) обновить их содержание. |
| GetDefaultCanvasMaterial | Возвращает материал по умолчанию, который может быть использован для рендеринга обычных элементов на полотне (Canvas). |
| GetETC1SupportedCanvasMaterial | Gets or generates the ETC1 material. |
| willRenderCanvases | Событие, которое вызывается непосредственно перед тем как произойдет рендеринг Canvas. |
| enabled | Включенное Поведение обновляется, выключенное Поведение не обновляется. |
| isActiveAndEnabled | Has the Behaviour had enabled called. |
| gameObject | Игровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту. |
| tag | Тег данного игрового объекта. |
| transform | The Transform attached to this GameObject (null if there is none attached). |
| hideFlags | Should the object be hidden, saved with the scene or modifiable by the user? |
| name | The name of the object. |
| BroadcastMessage | Вызывает метод с именем methodName на каждом скрипте MonoBehaviour этого игрового объекта или на любом из его потомков. |
| CompareTag | Помечен ли данный игровой объект тегом tag? |
| GetComponent | Возвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен. |
| GetComponentInChildren | Возвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину. |
| GetComponentInParent | Возвращает компонент типа type в GameObject или любого из его родителей. |
| GetComponents | Возвращает все компоненты типа type в GameObject. |
| GetComponentsInChildren | Возвращает все компоненты типа type в GameObject или любому из его потомков. |
| GetComponentsInParent | Возвращает все компоненты типа type в GameObject или любому из его родителей. |
| SendMessage | Вызывает метод с именем methodName в каждом MonoBehaviour на этом объекте. |
| SendMessageUpwards | Вызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения. |
| GetInstanceID | Returns the instance id of the object. |
| ToString | Returns the name of the game object. |
| Destroy | Удаляет GameObject, Component или Asset. |
| DestroyImmediate | Destroys the object obj immediately. |
| DontDestroyOnLoad | Makes the object target not be destroyed automatically when loading a new scene. |
| FindObjectOfType | Returns the first active loaded object of Type type. |
| FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
| Instantiate | Returns a copy of the object original. |
| bool | Does the object exist? |
| operator != | Compares if two objects refer to a different object. |
| operator == | Compares two object references to see if they refer to the same object. |