D
D
Dmitry Korolev2018-07-04 23:26:40
Unity
Dmitry Korolev, 2018-07-04 23:26:40

How to call from the code what happens on a double click on a th in the hierarchy?

How to call from the code what happens when you double-click on a game object in the hierarchy (the scene view moves to look at it)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Korolev, 2018-07-05
@adressmoeistranici

SceneView.lastActiveSceneView.AlignViewToObject(transform);

D
Daniil Basmanov, 2018-07-05
@BasmanovDaniil

Either change Selection.activeGameObject and call SceneView.FrameSelected, or calculate Bounds and call SceneView.Frame.

Selection.activeGameObject = gameObject;

SceneView.currentDrawingSceneView.FrameSelected();
// или
SceneView.lastActiveSceneView.FrameSelected();
// или
EditorWindow.GetWindow<SceneView>().FrameSelected();

You can also look at the source code and look for other ways.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question