Version: 2018.1
public static void DrawTexture (Rect screenRect, Texture texture, Material mat= null, int pass= -1);
public static void DrawTexture (Rect screenRect, Texture texture, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat= null, int pass= -1);
public static void DrawTexture (Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Material mat= null, int pass= -1);
public static void DrawTexture (Rect screenRect, Texture texture, Rect sourceRect, int leftBorder, int rightBorder, int topBorder, int bottomBorder, Color color, Material mat= null, int pass= -1);

Parameters

screenRect@param screenRect Прямоугольник на экране, используемый для текстуры. В пиксельных координатах левый верхний угол имеет координаты (0,0).
texture@param texture Texture для рисования.
sourceRect@param sourceRect Используемая область текстуры. В нормализованных координатах нижний левый угол имеет координаты (0,0).
leftBorder@param leftBorder Количество пикселей слева, не зависящих от масштаба.
rightBorder@param rightBorder Количество пикселей справа, независящих от масштаба.
topBorder@param leftBorder Количество пикселей слева, не зависящих от масштаба.
bottomBorder@param leftBorder Количество пикселей слева, не зависящих от масштаба.
color Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.
mat@param mat Пользовательский Material, который может быть использован при рисовании текстуры. Если задан null, используется материал по умолчанию с шейдером Internal-GUITexture.shader.
pass@param pass Если равно -1 (по умолчанию), то рисует все проходы материала. Иначе, рисует только указанный проход.

Description

Рисует текстуру в координатах экрана.

If you want to draw a texture from inside of OnGUI code, you should only do that from EventType.Repaint events. It's probably better to use GUI.DrawTexture for GUI code.

no example available in C#
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961