お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close実際にRenderTextureオブジェクトを作成します
レンダーテクスチャのコンストラクタだけでは作成されません。
デフォルトでは、この関数で作成されたテクスチャは active 変数の中に格納されます。
Create
をコールすることで最初に作成が出来ます。
すでにテクスチャが作成済みの場合 Create
は何もしません。
See Also: Release, IsCreated 関数.
var rt: RenderTexture; function Start () { rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32); rt.Create(); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public RenderTexture rt; void Start() { rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32); rt.Create(); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): public rt as RenderTexture def Start() as void: rt = RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32) rt.Create()