お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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このカメラの設定を他のカメラと同じようにします。
これは other
から全てのカメラの変数(field of view, clear flags, culling mask, ...)をコピーします。
また、このカメラのレイヤーも other
のレイヤーに一致するように、
カメラのtransformも一致します。
これはカスタムエフェクトをレンダリングする時に他のカメラと設定を一致させたい時に便利です。
例えば RenderWithShader を使用するときです。
// Set the current camera's settings from the main // scene camera. camera.CopyFrom(Camera.main);
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { camera.CopyFrom(Camera.main); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: camera.CopyFrom(Camera.main)