Version: 2023.1
言語: 日本語
public bool Create ();

戻り値

bool True if the texture is created, else false.

説明

実際に RenderTexture オブジェクトを作成します

RenderTexture constructor does not actually create the hardware texture; by default the texture is created the first time it is set active. Calling Create lets you create it up front. Create does nothing if the texture is already created.

The initial contents of a newly created render texture are undefined. On some platforms and APIs the contents will default to black, but you shouldn't depend on this. You can use LoadStoreActionDebugModeSettings to highlight undefined areas of the display, to help you debug rendering problems on mobile platforms.

関連項目: ReleaseIsCreated 関数 .

using UnityEngine;

public class Example : MonoBehaviour { public RenderTexture rt;

void Start() { rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32); rt.Create();

// Add code here to work on the render texture

// Release the hardware resources used by the render texture rt.Release(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961