Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Graphics.DrawMeshNow

マニュアルに切り替える
public static void DrawMeshNow(Mesh mesh, Vector3 position, Quaternion rotation);
public static void DrawMeshNow(Mesh mesh, Vector3 position, Quaternion rotation, int materialIndex);
public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix);
public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix, int materialIndex);

パラメーター

mesh 描画する Mesh
position メッシュの位置
rotation メッシュの角度
matrix メッシュの変換行列 (位置、回転やその他の変換を組み合わせます) 。行列が負のスケールを持っている場合、メッシュが正しく表示されないことに注意してください。
materialIndex 描画するメッシュのサブセット

説明

すぐにメッシュを描画する

この関数は指定したメッシュをすぐに描画します。現在設定されている シェーダーとマテリアル (Material.SetPass を参照) が使用されます。

メッシュは一度だけ描画され、 ピクセルごとに Lit せず、リアルタイムでシャドウをキャストやレシーブすることはありません。 ライティングとシャド ウイングを完全に統合したい場合は代わりに Graphics.DrawMesh を使用します。

using UnityEngine;
using System.Collections;

// Attach this script to a Camera public class ExampleClass : MonoBehaviour { public Mesh mesh; public Material mat; public void OnPostRender() { // set first shader pass of the material mat.SetPass(0); // draw mesh at the origin Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity); } }