Class Editor
The main managed editor class. Editor root object.
Inheritance
Namespace: FlaxEditor
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Editor : Object
Fields
CodeDocs
CodeEditing
ContentDatabase
The content database module.
Declaration
public ContentDatabaseModule ContentDatabase
Field Value
ContentEditing
The content editing module.
Declaration
public ContentEditingModule ContentEditing
Field Value
ContentFinding
The content finder module.
Declaration
public ContentFindingModule ContentFinding
Field Value
ContentImporting
The content importing module.
Declaration
public ContentImportingModule ContentImporting
Field Value
CustomData
The custom data container that is stored in Editor instance. Can be used by plugins to store the state during editor session (state is preserved during scripts reloads).
Declaration
public Dictionary<string, string> CustomData
Field Value
System.
|
EngineProject
GameProject
Icons
The icons container.
Declaration
public EditorIcons Icons
Field Value
Flax
|
LocalCachePath
The path to the local cache folder shared by all the installed editor instance for a given user (used also by the Flax Launcher).
Declaration
public static readonly string LocalCachePath
Field Value
System.
|
Options
Prefabs
ProgressReporting
The progress reporting module.
Declaration
public ProgressReportingModule ProgressReporting
Field Value
ProjectCache
The editor per-project cache manager.
Declaration
public ProjectCacheModule ProjectCache
Field Value
Scene
SceneEditing
The scene editing module.
Declaration
public SceneEditingModule SceneEditing
Field Value
Simulation
StateMachine
The editor state machine.
Declaration
public EditorStateMachine StateMachine
Field Value
Flax
|
Thumbnails
UI
Undo
Windows
Properties
Instance
IsEveryAssemblyLoaded
Checks if every managed assembly has been loaded (including user scripts assembly).
Declaration
public static bool IsEveryAssemblyLoaded { get; }
Property Value
System.
|
IsFlaxEngineTheBest
Gets a value indicating whether Flax Engine is the best in the world.
Declaration
public bool IsFlaxEngineTheBest { get; }
Property Value
System.
|
IsHeadlessMode
Gets a value indicating whether this Editor is running in headless
mode. No windows or popups should be shown. Used in CL environment (without a graphical user interface).
Declaration
public bool IsHeadlessMode { get; }
Property Value
System.
|
IsInitialized
Gets a value indicating whether Editor instance is initialized.
Declaration
public bool IsInitialized { get; }
Property Value
System.
|
IsPlayMode
True if the editor is running now in a play mode. Assigned by the managed editor instance.
Declaration
public static bool IsPlayMode { get; }
Property Value
System.
|
LastProjectOpenedEngineBuild
Gets the build number of the last editor instance that opened the current project. Value 0 means the undefined version.
Declaration
public static int LastProjectOpenedEngineBuild { get; }
Property Value
System.
|
MainTransformGizmo
Gets the main transform gizmo used by the Scene
Declaration
public TransformGizmo MainTransformGizmo { get; }
Property Value
Flax
|
Methods
add_LightmapsBakeEnd(Editor.LightmapsBakeEndDelegate)
Declaration
public static void add_LightmapsBakeEnd(Editor.LightmapsBakeEndDelegate value)
Parameters
add_LightmapsBakeProgress(Editor.LightmapsBakeProgressDelegate)
Declaration
public static void add_LightmapsBakeProgress(Editor.LightmapsBakeProgressDelegate value)
Parameters
BakeAllEnvProbes()
Bakes all environmental probes in the scene.
Declaration
public void BakeAllEnvProbes()
BakeLightmapsOrCancel()
Starts lightmaps baking for the open scenes or cancels it if already running.
Declaration
public void BakeLightmapsOrCancel()
BuildAllMeshesSDF()
Builds SDF for all static models in the scene.
Declaration
public void BuildAllMeshesSDF()
BuildCSG()
Builds CSG for all open scenes.
Declaration
public void BuildCSG()
BuildNavMesh()
BuildScenesOrCancel()
Starts building scenes data or cancels it if already running.
Declaration
public void BuildScenesOrCancel()
CanExport(String)
Checks if the given asset can be exported.
Declaration
public static bool CanExport(string path)
Parameters
System. The asset path (absolute path with an extension). |
Returns
System. True if can export given asset, otherwise false. |
CanImport(String, out String)
Checks if can import asset with the given extension.
Declaration
public static bool CanImport(string extension, out string outputExtension)
Parameters
System. The file extension. |
System. The output file extension (flax, json, etc.). |
Returns
System. True if can import files with given extension, otherwise false. |
ClearLightmaps()
Clears the lightmaps linkage for all open scenes.
Declaration
public void ClearLightmaps()
CloseSplashScreen()
Closes editor splash screen popup window.
Declaration
public static void CloseSplashScreen()
CookMeshCollision(String, CollisionDataType, ModelBase, Int32, UInt32, ConvexMeshGenerationFlags, Int32)
Cooks the mesh collision data and saves it to the asset using Collision
Declaration
public static bool CookMeshCollision(string path, CollisionDataType type, ModelBase model, int modelLodIndex = 0, uint materialSlotsMask = 4294967295U, ConvexMeshGenerationFlags convexFlags, int convexVertexLimit = 255)
Parameters
System. The output asset path. |
Collision The collision data type. |
Model The source model. |
System. The source model LOD index. |
System. The source model material slots mask. One bit per-slot. Can be used to exclude particular material slots from collision cooking. |
Convex The convex mesh generation flags. |
System. The convex mesh vertex limit. Use values in range [8;255] |
Returns
System. True if failed, otherwise false. |
CreateAsset(Editor.NewAssetType, String)
Creates new asset at the target location. [Deprecated in v1.8]
Declaration
public static bool CreateAsset(Editor.NewAssetType type, string outputPath)
Parameters
Editor. New asset type. |
System. Output asset path. |
Returns
System.
|
CreateAsset(String, String)
Creates a new asset at the target location.
Declaration
[Unmanaged]
public static bool CreateAsset(string tag, string outputPath)
Parameters
System. New asset type. |
System. Output asset path. |
Returns
System.
|
CreateVisualScript(String, String)
Creates new Visual Script asset at the target location.
Declaration
public static bool CreateVisualScript(string outputPath, string baseTypename)
Parameters
System. Output asset path. |
System. Base class typename. |
Returns
System.
|
EnsureState(EditorState)
Ensure that editor is in a given state, otherwise throws Flax
Declaration
public void EnsureState(EditorState state)
Parameters
Flax Valid state to check. |
Exceptions
Flax
|
EnsureState<TStateType>()
Ensure that editor is in a state of given type, otherwise throws Flax
Declaration
public void EnsureState<TStateType>()
Type Parameters
TStateType
The type of the state type. |
Export(String, String)
Exports the given asset to the specified file location.
Declaration
public static bool Export(string inputPath, string outputFolder)
Parameters
System. The input asset path (absolute path with an extension). |
System. The output folder path (filename with extension is computed by auto). |
Returns
System. True if given asset has been exported, otherwise false. |
GetActorEditorSphere(Actor, out BoundingSphere)
Gets the actor bounding sphere (including child actors).
Declaration
public static void GetActorEditorSphere(Actor actor, out BoundingSphere sphere)
Parameters
Actor
actor
The actor. |
Bounding The bounding sphere. |
GetAssetReferences(Guid)
Gets a list of asset references of a given asset.
Declaration
[Unmanaged]
public static Guid[] GetAssetReferences(Guid assetId)
Parameters
System. The asset ID. |
Returns
System. List of referenced assets. |
GetShaderSourceCode(Material)
Gets the material shader source code (HLSL shader code).
Declaration
public static string GetShaderSourceCode(Material asset)
Parameters
Material
asset
The material asset. |
Returns
System. The generated source code. |
GetShaderSourceCode(ParticleEmitter)
Gets the particle emitter GPU simulation shader source code (HLSL shader code).
Declaration
public static string GetShaderSourceCode(ParticleEmitter asset)
Parameters
Particle The particle emitter asset. |
Returns
System. The generated source code. |
GetShaderSourceCode(Shader)
Gets the shader source code (HLSL shader code).
Declaration
public static string GetShaderSourceCode(Shader asset)
Parameters
Shader
asset
The shader asset. |
Returns
System. The generated source code. |
Import(String, String, AudioTool.Options)
Imports the audio asset file to the target location.
Declaration
[Unmanaged]
public static bool Import(string inputPath, string outputPath, AudioTool.Options options)
Parameters
System. The source file path. |
System. The result asset file path. |
Flax The import settings. |
Returns
System. True if importing failed, otherwise false. |
Import(String, String, ModelTool.Options)
Imports the model asset file to the target location.
Declaration
[Unmanaged]
public static bool Import(string inputPath, string outputPath, ModelTool.Options options)
Parameters
System. The source file path. |
System. The result asset file path. |
Flax The import settings. |
Returns
System. True if importing failed, otherwise false. |
Import(String, String, TextureTool.Options)
Imports the texture asset file to the target location.
Declaration
[Unmanaged]
public static bool Import(string inputPath, string outputPath, TextureTool.Options options)
Parameters
System. The source file path. |
System. The result asset file path. |
Flax The import settings. |
Returns
System. True if importing failed, otherwise false. |
Import(String, String, IntPtr)
Imports the asset file to the target location.
Declaration
[Unmanaged]
public static bool Import(string inputPath, string outputPath, IntPtr arg = default(IntPtr))
Parameters
System. The source file path. |
System. The result asset file path. |
System. The custom argument 9native data). |
Returns
System. True if importing failed, otherwise false. |
OpenProject(String)
Closes this project with running editor and opens the given project.
Declaration
public void OpenProject(string projectFilePath)
Parameters
System. The project file path. |
PerformRedo()
Redo last action.
Declaration
public void PerformRedo()
PerformUndo()
Undo last action.
Declaration
public void PerformUndo()
remove_LightmapsBakeEnd(Editor.LightmapsBakeEndDelegate)
Declaration
public static void remove_LightmapsBakeEnd(Editor.LightmapsBakeEndDelegate value)
Parameters
remove_LightmapsBakeProgress(Editor.LightmapsBakeProgressDelegate)
Declaration
public static void remove_LightmapsBakeProgress(Editor.LightmapsBakeProgressDelegate value)
Parameters
SaveAll()
Saves all changes (scenes, assets, etc.).
Declaration
public void SaveAll()
SaveContent()
Saves all content (assets, etc.).
Declaration
public void SaveContent()
SaveJsonAsset(String, Object)
Serializes the given object to json asset.
Declaration
public static bool SaveJsonAsset(string outputPath, object obj)
Parameters
System. The result asset file path. |
System. The obj to serialize. |
Returns
System. True if saving failed, otherwise false. |
TryRestoreImportOptions(ref AudioTool.Options, String)
Tries the restore the asset import options from the target resource file.
Declaration
[Unmanaged]
public static bool TryRestoreImportOptions(ref AudioTool.Options options, string assetPath)
Parameters
Flax The options. |
System. The asset path. |
Returns
System. True settings has been restored, otherwise false. |
TryRestoreImportOptions(ref ModelTool.Options, String)
Tries the restore the asset import options from the target resource file.
Declaration
[Unmanaged]
public static bool TryRestoreImportOptions(ref ModelTool.Options options, string assetPath)
Parameters
Flax The options. |
System. The asset path. |
Returns
System. True settings has been restored, otherwise false. |
TryRestoreImportOptions(ref TextureTool.Options, String)
Tries the restore the asset import options from the target resource file.
Declaration
[Unmanaged]
public static bool TryRestoreImportOptions(ref TextureTool.Options options, string assetPath)
Parameters
Flax The options. |
System. The asset path. |
Returns
System. True settings has been restored, otherwise false. |
Events
EditorUpdate
Fired on Editor update
Declaration
public event Action EditorUpdate
Event Type
System.
|
EnvProbeBakeEnd
Occurs when environment probe baking ends.
Declaration
public static event Action<EnvironmentProbe> EnvProbeBakeEnd
Event Type
System.
|
EnvProbeBakeStart
Occurs when environment probe baking starts.
Declaration
public static event Action<EnvironmentProbe> EnvProbeBakeStart
Event Type
System.
|
InitializationEnd
Occurs when editor initialization ends. All editor modules already received OnEndInit callback and editor splash screen will be closed.
Declaration
public event Action InitializationEnd
Event Type
System.
|
InitializationStart
Occurs when editor initialization starts. All editor modules already received OnInit callback and editor splash screen is visible.
Declaration
public event Action InitializationStart
Event Type
System.
|
LightmapsBakeEnd
Occurs when lightmaps baking ends.
Declaration
public static event Editor.LightmapsBakeEndDelegate LightmapsBakeEnd
Event Type
LightmapsBakeProgress
Occurs when lightmaps baking progress changes.
Declaration
public static event Editor.LightmapsBakeProgressDelegate LightmapsBakeProgress
Event Type
LightmapsBakeStart
Occurs when lightmaps baking starts.
Declaration
public static event Action LightmapsBakeStart
Event Type
System.
|
PlayModeBegin
Occurs when play mode begins (after entering play mode).
Declaration
public event Action PlayModeBegin
Event Type
System.
|
PlayModeBeginning
Occurs when play mode is beginning (before entering play mode).
Declaration
public event Action PlayModeBeginning
Event Type
System.
|
PlayModeEnd
Occurs when play mode ends (after leaving play mode).
Declaration
public event Action PlayModeEnd
Event Type
System.
|
PlayModeEnding
Occurs when play mode is ending (before leaving play mode).
Declaration
public event Action PlayModeEnding
Event Type
System.
|