It appears that only changes to the target platform are currently supported.
There seems to be no detection or notification of changes to the individual contents of Build Settings.
Chapter 13 Callback for Various Events
13.6 EditorUserBuildSettings.activeBuildTargetChanged
Callback that is invoked when a platform is changed by the Build Settings window or EditorUserBuildSettings.SwitchActiveBuildTarget.Different platform configurations, such as BundleIdentifier changes, or changes to the contents of StreamingAsets and Resources folders.
You will probably set up a callback to register with this variable.
EditorUserBuildSettings.activeBuildTargetChanged
public static var activeBuildTargetChanged:Action;
Description
Configure the callback that is invoked immediately after a platform change in SwitchActiveBuildTarget
See Also: System.Action.
This is the related method.
EditorUserBuildSettings.SwitchActiveBuildTarget
public static function SwitchActiveBuildTarget (target:BuildTarget):bool;
Description
Change Build Target
Note: This method is not available when starting the editor in batch mode.
If you want to know the details other than changing the target platform, I'm afraid
Wouldn't it be possible to register this callback?
13.13 EditorApplication.globalEventHandler
Callback that occurs when an event occurs throughout the Unity editor.This has not been officially published, but it is useful for identifying key events and mouse locations.
The code below is a wrapper class that makes globalEventHandler easy to use.
Note) Diagram omitted.
Figure 13.9: Pressing the key at the appropriate time will display the log.
Note) code omitted
Note, however, that it does not work in game views or in some other windows.
It seems that there is a description like this.Is this better suited for proprietary callback implementations?
13.11 EditorApplication.update
Callback called at the Unity editor update timing.The editor also has a certain update timing, such as MonoBehavior Update.It is called approximately 200 times per second and is performed before the drawing system process.*4
[*4] There are reports of bugs running 200 times per second.The document says 100 times per second.
For example, WWW communications can also be used.
Note) code omitted
You can also use it to implement your own callback.
The code below creates a callback that is invoked every time the focused EditorWindow changes.
Note) I omit the code, but this is an example implementation:See where to find it
These are the variables for the above configuration.
EditorApplication.update
public static var update:CallbackFunction;
Description
Deligate for UnityEditor update processing
Adds a callback to this delivery that is called approximately 100 times per second. See Also: EditorApplication.CallbackFunction.
using UnityEditor;
using UnityEngine;
public class SceneListChangedMonitor:MonoBehavior
{
Initialize OnLoadMethod
static void initialize()
{
Debug.Log ("Start Monitoring Scene List");
EditorBuildSettings.sceneListChanged+=()=>
{
// Get scene name and state from scene list
foreach (varscene in EditorBuildSettings.scenes)
{
Debug.Log($"Scene={scene.path}is{scene.enabled}");
}
};
}
}
This is how the code that displays the scene list in the console log when there is a change in the scene list in Build Settings is implemented.
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.