Version: 2019.4

Texture2D

class in UnityEngine

/

継承:Texture

マニュアルに切り替える

説明

Class that represents textures in C# code.

Use this class to create textures, or to modify existing texture assets.

The ImageConversion class provides extension methods to this class that handle image encoding functionality. For details on those methods, see the ImageConversion documentation.

Static 変数

blackTextureGets a small Texture with all black pixels.
grayTextureGets a small Texture with all gray pixels.
linearGrayTextureGets a small Texture with all gray pixels.
normalTextureGets a small Texture with pixels that represent surface normal vectors at a neutral position.
redTextureGets a small Texture with all red pixels.
whiteTextureGets a small Texture with all white pixels.

変数

alphaIsTransparencyIndicates whether this texture was imported with TextureImporter.alphaIsTransparency enabled. This setting is available only in the Editor scripts. Note that changing this setting will have no effect; it must be enabled in TextureImporter instead.
calculatedMipmapLevelThe mipmap level calculated by the streaming system, which takes into account the streaming Cameras and the location of the objects containing this Texture. This is unaffected by requestedMipmapLevel or minimumMipmapLevel.
desiredMipmapLevelThe mipmap level that the streaming system would load before memory budgets are applied.
formatテクスチャのピクセルデータをフォーマットする
isReadableReturns true if the Read/Write Enabled checkbox was checked when the texture was imported; otherwise returns false. For a dynamic Texture created from script, always returns true. For additional information, see TextureImporter.isReadable.
loadedMipmapLevelThe mipmap level that is currently loaded by the streaming system.
loadingMipmapLevelThe mipmap level that the mipmap streaming system is in the process of loading.
minimumMipmapLevelRestricts the mipmap streaming system to a minimum mip level for this Texture.
requestedMipmapLevelThe mipmap level to load.
streamingMipmapsDetermines whether mipmap streaming is enabled for this Texture.
streamingMipmapsPrioritySets the relative priority for this Texture when reducing memory size to fit within the memory budget.

コンストラクタ

Texture2D新規の空のテクスチャを作成します

Public 関数

Apply SetPixel 関数と SetPixels 関数による変更を適用します
ClearMinimumMipmapLevelResets the minimumMipmapLevel field.
ClearRequestedMipmapLevelResets the requestedMipmapLevel field.
CompressDXT 形式にテクスチャを圧縮します
GetPixel座標(x, y)のピクセルのカラーを取得します
GetPixelBilinear正規化座標(u, v)でフィルタリングされたピクセルのカラーを取得します
GetPixelsテクスチャからピクセル色を取得します。
GetPixels32Color32 形式のピクセルのカラー配列を取得します
GetRawTextureDataGet raw data from a texture for reading or writing.
IsRequestedMipmapLevelLoadedChecks to see whether the mipmap level set by requestedMipmapLevel has finished loading.
LoadRawTextureDataRaw 形式データを読み取ってテクスチャのピクセルを格納します。
PackTexturesテクスチャアトラスに複数のテクスチャをパックします
ReadPixelsスクリーン画面からテクスチャデータへと保存するためのピクセルデータを読み込みます
Resizeテクスチャをリサイズします
SetPixel座標(x, y)のピクセルのカラーを設定します
SetPixelDataSet pixel values from raw preformatted data.
SetPixelsピクセルカラー配列を設定します
SetPixels32ピクセルカラー配列を設定します
UpdateExternalTexture異なるネイティブのテクスチャオブジェクトを使うために Unity のテクスチャを更新します。

Static 関数

CreateExternalTexture外部で作成されたネイティブのテクスチャオブジェクトから Unity テクスチャを作成します。
GenerateAtlasPacks a set of rectangles into a square atlas, with optional padding between rectangles.

継承メンバー

Static 変数

allowThreadedTextureCreationAllow texture creation to occur on any thread (rather than the dedicated render thread).
currentTextureMemoryThe amount of memory currently being used by textures.
desiredTextureMemoryThis amount of texture memory would be used before the texture streaming budget is applied.
GenerateAllMipsCan be used with texture constructors that take a mip count to indicate that all mips should be generated. The value of this field is -1.
nonStreamingTextureCountNumber of non-streaming textures.
nonStreamingTextureMemoryTotal amount of memory being used by non-streaming textures.
streamingMipmapUploadCountHow many times has a texture been uploaded due to texture mipmap streaming.
streamingRendererCountNumber of renderers registered with the texture streaming system.
streamingTextureCountNumber of streaming textures.
streamingTextureDiscardUnusedMipsForce the streaming texture system to discard all unused mipmaps immediately, rather than caching them until the texture memory budget is exceeded.
streamingTextureForceLoadAllForce streaming textures to load all mipmap levels.
streamingTextureLoadingCountNumber of streaming textures with mipmaps currently loading.
streamingTexturePendingLoadCountNumber of streaming textures with outstanding mipmaps to be loaded.
targetTextureMemoryThe amount of memory used by textures after the mipmap streaming and budget are applied and loading is complete.
totalTextureMemoryThe total amount of memory that would be used by all textures at mipmap level 0.

変数

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名
anisoLevelテクスチャの異方性フィルタリングのレベル
dimensionテクスチャの次元 (タイプ)。読み取り専用。
filterModeテクスチャのフィルタリングモード
graphicsFormatReturns the GraphicsFormat format or color format of a texture object.
heightピクセル単位でのテクスチャの高さ(読み取り専用)
imageContentsHashThe hash value of the Texture.
isReadableReturns true if the Read/Write Enabled checkbox was checked when the texture was imported; otherwise returns false. For a dynamic Texture created from script, always returns true. For additional information, see TextureImporter.isReadable.
mipMapBiasミップマップのバイアス
mipmapCountテクスチャのミップマップレベル(読み取り専用)
updateCountThis counter is incremented when the texture is updated.
widthピクセル単位でのテクスチャの幅(読み取り専用)
wrapModeTexture coordinate wrapping mode.
wrapModeUTexture U coordinate wrapping mode.
wrapModeVTexture V coordinate wrapping mode.
wrapModeWTexture W coordinate wrapping mode for Texture3D.

Public 関数

GetInstanceIDオブジェクトのインスタンス ID を返します
ToStringReturns the name of the object.
GetNativeTexturePtrテクスチャリソースへのネイティブ (グラフィックス API に内在する) ポインターを取得します。
IncrementUpdateCountIncrement the update counter.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeタイプから見つけたすべてのアクティブのオブジェクト配列を返します
Instantiateoriginal のオブジェクトをクローンします
SetGlobalAnisotropicFilteringLimits異方性のリミットを設定します
SetStreamingTextureMaterialDebugPropertiesUploads additional debug information to materials using textures set to stream mip maps.

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961