- Home /
runInBackground in Edit Mode
I need to find a method to force Unity Editor in Edit mode to update the scene even if don't have the focus. Application.runInBackground or PlayerSettings.runInBackground works ONLY in Play mode.
Here a gif to explain better, i use Win+E to open another window and test the losing focus.
Any advice? thanks.
Tested with Unity 5.4.3 (any 5.*) - Empty 3D project, only a cube and one static class:
using UnityEngine;
using UnityEditor;
using System.Collections;
[InitializeOnLoad]
class MyTestEdit
{
static MyTestEdit()
{
EditorApplication.update += OnUpdate; // Only to see if updated in Edit Mode
PlayerSettings.runInBackground = true; // Only useful in Play Mode
Application.runInBackground = true; // ?
}
private static void OnUpdate()
{
GameObject.Find("Cube").transform.Rotate(new Vector3(8, 5, 3));
}
}
(p.s. gif as link because the image uploader here don't accept it)
Your answer
![](https://koobas.hobune.stream/wayback/20220612103725im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Access Monobehavior Instance from Static Function of Editor Script 1 Answer
Is it possible to have editor-only native plugins? 0 Answers
Editor scripting - How to show the Assets menu as a context menu 1 Answer
Cannot close/unload a scene that is open in editor during playmode (using C# code)? 3 Answers
Custom Inspector for a List ? 2 Answers