Version: 2021.3
言語: 日本語
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/API's the contents will default to black but users should not depend on this.

関連項目: ReleaseIsCreated 関数 .

using UnityEngine;

public class Example : MonoBehaviour { public RenderTexture rt;

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