Version: 2017.3

説明

OnRenderObject はカメラがシーンをレンダリングした後に呼び出されます。

これは Graphics.DrawMeshNow や他の関数を使用して自身のオブジェクトをレンダリングする際に使用することができます。 この関数はカメラがアタッチされていなくても 関数のあるスクリプトを持つ任意のオブジェクトから呼び出すことができる以外は OnPostRender と似ています。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Mesh mainMesh; public Mesh miniMapMesh; void OnRenderObject() { if (Camera.current.name == "MiniMapcam") Graphics.DrawMeshNow(miniMapMesh, transform.position, transform.rotation); else Graphics.DrawMeshNow(mainMesh, transform.position, transform.rotation); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961