Version: 5.3 (switch to 5.4b)
ЯзыкEnglish
  • C#
  • JS

Язык программирования

Выберите подходящий для вас язык программирования. Все примеры кода будут представлены на выбранном языке.

SpriteRenderer

class in UnityEngine

/

Наследует от:Renderer

Предложить изменения

Успех!

Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.

Закрыть

Ошибка внесения изменений

По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста <a>попробуйте снова</a> через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.

Закрыть

Отменить

Руководство

Описание

Визуализирует спрайт для 2D графики.

Переменные

colorВизуализация цвета спрайта.
flipXЗеркально отражает спрайт по оси X.
flipYЗеркально отражает спрайт по оси Y.
spriteСпрайт для визуализации.

Унаследованные члены

Переменные

gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.
boundsThe bounding volume of the renderer (Read Only).
enabledMakes the rendered 3D object visible if enabled.
isPartOfStaticBatchHas this renderer been statically batched with any other renderers?
isVisibleIs this renderer visible in any camera? (Read Only)
lightmapIndexИндекс карты освещения, примененной при визуализации.
lightmapScaleOffsetThe UV scale & offset used for a lightmap.
localToWorldMatrixMatrix that transforms a point from local space into world space (Read Only).
materialReturns the first instantiated Material assigned to the renderer.
materialsReturns all the instantiated materials of this object.
probeAnchorЕсли установлено, Renderer будет использовать позицию Transform's, чтобы найти интерполированные светопробы.
realtimeLightmapIndexИндекс карты освещения, примененной при визуализации.
realtimeLightmapScaleOffsetThe UV scale & offset used for a realtime lightmap.
receiveShadowsDoes this object receive shadows?
reflectionProbeUsageShould reflection probes be used for this Renderer?
shadowCastingModeDoes this object cast shadows?
sharedMaterialThe shared material of this object.
sharedMaterialsAll the shared materials of this object.
sortingLayerIDUnique ID of the Renderer's sorting layer.
sortingLayerNameName of the Renderer's sorting layer.
sortingOrderRenderer's order within a sorting layer.
useLightProbesShould light probes be used for this Renderer?
worldToLocalMatrixMatrix that transforms a point from world space into local space (Read Only).

Открытые функции

BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли этот игровой объект тэгом tag?
GetComponentВозвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageВызывает метод с именем methodName в каждом MonoBehaviour на этом объекте.
SendMessageUpwardsВызывает на каждом MonoBehaviour в данном игровом объекте и на каждом предке скрипта метод с именем methodName.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.
GetClosestReflectionProbesReturns an array of closest reflection probes with weights, weight shows how much influence the probe has on the renderer, this value is also used when blending between reflection probes occur.
GetPropertyBlockGet per-renderer material property block.
SetPropertyBlockLets you add per-renderer material parameters without duplicating a material.

Статические функции

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateReturns a copy of the object original.

Операторы

boolDoes 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.

Сообщения

OnBecameInvisible OnBecameInvisible is called when the object is no longer visible by any camera.
OnBecameVisible OnBecameVisible is called when the object became visible by any camera.