CameraSettings

class in UnityEditor

Cambiar al Manual

Descripción

Use this class to set SceneView Camera properties.

// Create a folder (right click in the Assets directory, click Create>Folder)
// and name it Editor if one doesn't exist already. Create a new C# script called CustomSettings
// and place it in that folder.

// This script creates a new menu item Edit>SceneView Settings>Update Camera Settings in the main menu. // Use it to update the Camera settings in the Scene view.

using UnityEditor;

public class CustomSettings { [MenuItem("Edit/SceneView Settings/Update Camera Settings")] static void UpdateCameraSettings() { SceneView.CameraSettings settings = new SceneView.CameraSettings(); settings.accelerationEnabled = false; settings.speedMin = 1f; settings.speedMax = 10f; settings.speed = 5f; settings.easingEnabled = true; settings.easingDuration = 0.6f; settings.dynamicClip = false; settings.fieldOfView = 120f; settings.nearClip = 0.01f; settings.farClip = 1000f; settings.occlusionCulling = true; SceneView sceneView = SceneView.lastActiveSceneView; sceneView.cameraSettings = settings; } }

Variables

accelerationEnabledEnables Camera movement acceleration in the SceneView. This makes the Camera accelerate for the duration of movement.
dynamicClipWhen enabled, the SceneView Camera's near and far clipping planes are calculated relative to the viewport size of the Scene. When disabled, nearClip and farClip are used instead.
easingDurationHow long it takes for the speed of the SceneView Camera to accelerate to its initial full speed. Measured in seconds. Valid values are between [0.1, 2].
easingEnabledEnables Camera movement easing in the SceneView. This makes the Camera ease in when it starts moving, and ease out when it stops.
farClipThe furthest point from the SceneView Camera that drawing occurs. The valid minimum value is 0.02.
fieldOfViewThe height of the SceneView Camera's view angle. Measured in degrees vertically, or along the local Y axis.
nearClipThe closest point to the SceneView Camera where drawing occurs. The valid minimum value is 0.01.
occlusionCullingEnables occlusion culling in the SceneView. This prevents Unity from rendering GameObjects that the Camera cannot see because they are hidden by other GameObjects.
speedThe speed of the SceneView Camera.
speedMaxThe maximum speed of the SceneView Camera. Valid values are between [0.02, 99].
speedMinThe minimum speed of the SceneView Camera. Valid values are between [0.01, 98].
speedNormalizedThe normalized speed of the SceneView Camera, relative to the current minimum/maximum range. Valid values are between [0, 1].

Constructores

SceneView.CameraSettingsCreate a new CameraSettings object.
Copyright © 2020 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961