Version: 2023.1
言語: 日本語

SceneView

class in UnityEditor

/

継承:EditorWindow


実装インターフェース:IHasCustomMenu, ISupportsOverlays

マニュアルに切り替える

説明

Use this class to manage SceneView settings, change the SceneView camera properties, subscribe to events, call SceneView methods, and render open scenes.

Static 変数

currentDrawingSceneViewThe SceneView that is being drawn.
lastActiveSceneViewThe SceneView that was most recently in focus.
lastActiveSceneViewChangedRegister to this callback to get notified when the active Scene View changes.
sceneViewsThe list of all open Scene view windows.
selectedOutlineColorGets the Color of selected outline.

変数

audioPlayEnables or disables Scene view audio effects.
cameraThe Camera that is rendering this SceneView.
cameraDistanceThe distance from camera to pivot.
cameraModeThe current DrawCameraMode for the Scene view camera.
cameraSettingsUse CameraSettings to set the properties for the SceneView Camera.
cameraViewportThe position and size of the area that the camera renders.
drawGizmosSets the visibility of all Gizmos in the Scene view.
in2DModeWhether the SceneView is in 2D mode.
isRotationLockedWhether the Scene view camera can be rotated.
isUsingSceneFilteringWhether this SceneView is using scene filtering.
lastSceneViewRotationWhen the Scene view is in 2D mode, this property contains the last camera rotation.
orthographicWhether the Scene view camera is set to orthographic mode.
pivotThe central point that the camera orbits within the Scene view.
rotationThe direction of the camera to the pivot of the SceneView.
sceneLightingWhether lighting is enabled or disabled in the Scene view.
sceneViewStateUse SceneViewState to set the debug options for the Scene view.
showGridGets or sets whether to enable the grid for an instance of the SceneView.
sizeThe size of the Scene view measured diagonally.
validateTrueMetalsWhether the albedo is black for materials with an average specular color above 0.45.

Public 関数

AlignViewToObjectMoves the Scene view to frame a transform.
AlignWithViewAligns the current selection with the position and rotation of the Scene view camera.
FrameFrames the given bounds in the Scene view.
FrameSelectedFrame the object selection in the Scene view.
IsCameraDrawModeEnabledReturns true if mode is enabled in the current rendering setup, including custom validators.
IsCameraDrawModeSupportedChecks if the current rendering configuration supports the CameraMode. The check includes custom validators.
LookAtMoves the Scene view to focus on a target.
LookAtDirect LookAt without animating the scene movement.
MoveToViewTransforms all selected object to the scene pivot.
ResetCameraSettingsResets the CameraSettings for the SceneView Camera to default.
SetSceneViewShaderReplaceSets a replacement shader for rendering this Scene view.

Protected 関数

SupportsStageHandlingOverride this method to control whether the Scene view should change when you switch from one stage to another stage.

Static 関数

AddCameraModeAdd a custom camera mode to the Scene view camera mode list.
AddOverlayToActiveViewAdd an Overlay to be displayed in the last focused Scene View. Overlays added to this static list will be automatically moved to the last active Scene View, and are displayed until removed.
ClearUserDefinedCameraModesRemove all user-defined camera modes.
FrameLastActiveSceneViewFrames the currently selected object(s) in the last active Scene view.
GetAllSceneCamerasRetrieves an array of all camera components from all open Scene views.
GetBuiltinCameraModeGets the built-in CameraMode that matches the specified DrawCameraMode.
RemoveOverlayFromActiveViewRemove an Overlay from displaying in the last focused Scene View.
RepaintAllRepaints every open SceneView.

Events

beforeSceneGuiThe event issued when the OnGUI method is called.
duringSceneGuiSubscribe to this event to receive a callback whenever the Scene view calls the OnGUI method.
gridVisibilityChangedInvoked when grid visibility changes.
onCameraModeChangedAn event that is invoked when the selected cameraMode changes.
onValidateCameraModeA multicast delegate for custom render pipelines to specify support for a requested CameraMode.

継承メンバー

Static 変数

focusedWindow現在キーボードフォーカスがある EditorWindow (Read Only)
focusedWindowChangedCalled whenever the focused editor window is changed.
mouseOverWindow現在マウスのカーソルの下の EditorWindow (Read Only)

変数

autoRepaintOnSceneChangeEnable this property to automatically repaint the window when the SceneView is modified.
dataModeControllerAn instance of IDataModeController to handle DataMode functionalities for the current window.
dockedReturns true if EditorWindow is docked.
hasFocusReturns true if EditorWindow is focused.
hasUnsavedChangesThis property specifies whether the Editor prompts the user to save or discard unsaved changes before the window closes.
maximizedIs this window maximized?
maxSizeThe maximum size of this window when it is floating or modal. The maximum size is not used when the window is docked.
minSizeThe minimum size of this window when it is floating or modal. The minimum size is not used when the window is docked.
overlayCanvasThe OverlayCanvas for this window.
positionThe desired position of the window in screen space.
rootVisualElementRetrieves the root visual element of this window hierarchy.
saveChangesMessageThe message that displays to the user if they are prompted to save
titleContentGUIContent は EditorWindows のタイトルを描画するために使用します。
wantsLessLayoutEventsSpecifies whether a layout pass is performed before all user events (for example, EventType.MouseDown or EventType.KeyDown), or is only performed before repaint events.
wantsMouseEnterLeaveWindowChecks whether MouseEnterWindow and MouseLeaveWindow events are received in the GUI in this Editor window.
wantsMouseMoveChecks whether MouseMove events are received in the GUI in this Editor window.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

BeginWindowsすべてのポップアップウィンドウを表示するための開始領域をマークします
Closeエディターウィンドウを閉じます
DiscardChangesDiscards unsaved changes to the contents of the window.
EndWindows EditorWindow.BeginWindows で開始したウィンドウグループを閉じます
FocusMoves keyboard focus to another EditorWindow.
GetExtraPaneTypesGets the extra panes associated with the window.
RemoveNotification表示している通知メッセージを停止します
Repaintウィンドウの再描画を行います
SaveChangesPerforms a save action on the contents of the window.
SendEventEvent をウィンドウに送信します
ShowShow the EditorWindow window.
ShowAsDropDownドロップダウンの動作とスタイルを持つウィンドウを表示します
ShowAuxWindow補助ウィンドウでエディターウィンドウを表示します
ShowModalShow modal editor window.
ShowModalUtilityShows the EditorWindow as a floating modal window.
ShowNotification通知メッセージを表示します
ShowPopupポップアップスタイルのフレーミングを使用するエディターウィンドウを表示します
ShowTabShows a docked Editor window.
ShowUtilityフローティングのユーティリティウィンドウとしてエディターウィンドウを表示します
TryGetOverlayGet an Overlay with matching ID from an EditorWindow canvas.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Protected 関数

OnBackingScaleFactorChangedCalled when the UI scaling for this EditorWindow is changed.

Static 関数

CreateWindowCreates an EditorWindow of type T.
FocusWindowIfItsOpenエディターウィンドウが開いている場合に探し出し、最初に見つけたものにフォーカスを当てます
GetWindowReturns the first EditorWindow of type windowType which is currently on the screen.
GetWindowWithRect現在画面上にある t タイプの最初に見つけた EditorWindow を返します
HasOpenInstancesChecks if an editor window is open.
DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします
CreateInstanceScriptableObject のインスタンスを作成します。

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。

メッセージ

Awake新規ウィンドウが開くときに呼び出されます
CreateGUICreateGUI is called when the EditorWindow's rootVisualElement is ready to be populated.
hasUnsavedChangesThis property specifies whether the Editor prompts the user to save or discard unsaved changes before the window closes.
OnBecameInvisibleCalled after the window is removed from a container view, or is no longer visible within a tabbed collection of EditorWindow.
OnBecameVisibleCalled after the window is added to a container view.
OnDestroyOnDestroy is called to close the EditorWindow window.
OnFocusウィンドウがキーボードフォーカスを取得するときに呼び出されます
OnGUIここに独自のエディターの GUI を実装します
OnHierarchyChangeHandler for message that is sent when an object or group of objects in the hierarchy changes.
OnInspectorUpdateOnInspectorUpdate は更新する機会をインスペクターに与え、秒当たり 10 回呼ばれます
OnLostFocusウィンドウがキーボードフォーカスを失ったときに呼び出されます
OnProjectChangeHandler for message that is sent whenever the state of the project changes.
OnSelectionChange選択が変更されるたび呼び出されます
saveChangesMessageThe message that displays to the user if they are prompted to save
Updateすべての表示されているウィンドウは秒あたり複数回呼び出されます
Awake ScriptableObject スクリプトを開始するとき、この関数は呼び出されます。
OnDestroyScriptableObject が破棄されるとき、この関数は呼び出されます。
OnDisableScriptableObject クラスのオブジェクトがスコープを外れるとき、この関数は呼び出されます。
OnEnableオブジェクトがロードされたとき、この関数は呼び出されます。
OnValidateEditor-only function that Unity calls when the script is loaded or a value changes in the Inspector.
Resetデフォルト値にリセットします