EditorUtility
public static abstract sealed class EditorUtility Properties
| Name | Type | Description |
|---|---|---|
InspectorObject static | Object | Set the object to be inspected by the inspector. |
IsVulkan static | Boolean | Used for shadergraph |
IsRecordingVideo static | Boolean | True if we're currently recording a video (using the video command, or F6) |
FontFamilies static | IEnumerable<String> | |
RenderSettings static | RenderSettings | Access to the client's render settings |
Methods
static Task<String> TranslateString(String input, String language) Translate input into language
static FloatBitmap LoadBitmap(String filename) Load a float bitmap. This is usually a png, tga, exr, psd
static Asset CreateModelFromMeshFile(Asset meshFile, String targetAbsolutePath = null) Create a vmdl file from a mesh. Will return non null if the asset was created successfully
static Asset CreateModelFromPolygonMeshes(PolygonMesh[] polygonMeshes, String targetAbsolutePath) Create a vmdl file from polygon meshes. Will return non null if the asset was created successfully
static Asset CreateModelFromMeshComponents(MeshComponent[] meshComponents, String targetAbsolutePath) Create a vmdl file from mesh components. Will return non null if the asset was created successfully. The model's origin will be placed at the first mesh component's position.
static Void AddLogger(Action<LogEvent> logger) static Void RemoveLogger(Action<LogEvent> logger) static AutoCompleteResult[] AutoComplete(String text, Int32 maxCount) static HashSet<IPanel> GetRootPanels() Get all the root panels.
static Void SendToRecycleBin(String filename) static Void OpenFolder(String path) Open a folder (or url)
static Void OpenFile(String path) Open a folder (or url)
static Void OpenFileFolder(String filepath) Open given file's folder in OS file explorer and select given file.
static Void MoveAssetToDirectory(Asset asset, String directory, Boolean overwrite = True) Moves an asset's source and compiled files to a directory (if they exist)
static Void RenameDirectory(String directory, String newDirectory, Boolean recursive = False) static Boolean RenameAsset(Asset asset, String newName) Moves a file to the same directory but gives it a new name
asset newName static Void CopyAssetToDirectory(Asset asset, String directory, Boolean overwrite = True) Copies an asset's source and compiled files to a directory (if they exist)
static Task<Boolean> PutAsync(Stream fileStream, String endpoint, Callback progress = null, CancellationToken token = null) static Task<Boolean> DownloadAsync(String url, String targetfile, Callback progress = null, CancellationToken token = null) static SceneWorld CreateSceneWorld() static Void StopAssetSound() Stop a sound playing from an asset preview
static Boolean PlayAssetSound(Asset asset) Plays an asset sound in 2d space
static Boolean PlayAssetSound(SoundEvent file) Plays an asset sound in 2d space
static Boolean PlayAssetSound(SoundFile file) Plays an asset sound in 2d space
static SoundHandle PlaySound(String sound, Single startTime = 0) Plays a sound event
static Boolean PlayRawSound(String file) Plays a sound via the OS, which is the way you play a sound if you want it to be heard when the game is tabbed away
static Void ClearPackageCache() Delete the cached package info. This will cause any future requests to get fresh information from the backend. This is useful if you just updated something and want to see the changes.
static WebSurface CreateWebSurface() Create an unlimited web surface
static SerializedObject GetSerializedObject(Object obj) Get a serialized object for this object. Because you're in the editor, this is an unrestricted object, we aren't whitelisting or using TypeLibrary.
static VideoWriter CreateVideoWriter(String path, Config config) Create a video writer
static IDisposable DisableTextureStreaming() Force textures to load fully when loading a model etc..
static Void Quit(Boolean toLauncher = False) Quit the whole engine
toLauncher — Open the launcher on exit, if it's not already open. static Void DisplayDialog(String title, String message, String okay = Okay, String icon = ⚠️, Widget parent = null) Display a modal dialog message. This is a blocking call.
static Void DisplayDialog(String title, String message, String noLabel, String yesLabel, Action action, String icon = ❓, Widget parent = null) Display a modal dialog message. This is a blocking call.
static Widget OpenControlSheet(SerializedObject so, Widget parent, Boolean createWindow = True) Show a popup control sheet for this. You should set parent to the control from this this sheet is created. If you do that properly, when that control is deleted, this popup will get deleted too. If you set it to null then the control sheet will stay open until it's closed.
static String GetSearchPaths() Gets every search path seperated by ;
static String KeyValues3ToJson(String kvString) Some assets are kv3, we want to convert them to json
static String KeyValues1ToJson(String kvString) Some old ass assets are keyvalues (1). Convert them to Json so we can use them.
static Pixmap GetFileThumbnail(String filePath, Int32 width, Int32 height) static Void RestartEditor() Restarts the editor with the same project.
static Void RestartEditorPrompt(String message, String title = Restart Editor) Open a dialog prompt asking the user to restart the editor.
message title static Boolean IsCodeFolder(String fullPath) Checks if a given folder is a code folder, e.g. [project root]/Code
fullPath static Boolean IsCodeFile(String fullPath) Checks if a given file is a code file
fullPath static this ISourceLocation GetSourceLocation(Scene scene) Gets the source location for the given scene, used by action graph stack traces, and so the action graph editor knows which asset to save when editing a graph.
static Project FindProjectByDirectory(String fullPath) Tries to find a project based on a given directory.
static GameObjectSystem GetGameObjectSystem(Scene scene, TypeDescription fromType) Gets a GameObjectSystem from its type
scene fromType static Task<Results> CompileShader(String localPath, ShaderCompileOptions options, CancellationToken token = null) Compile a fucking shader. Takes a .shader file and compiles it.
static Task<Results> CompileShader(BaseFileSystem fs, String localPath, ShaderCompileOptions options, CancellationToken token = null) static Void FindInScene(Component component) Finds a component in the scene and selects it in the editor
component static Void FindInScene(GameObject go) Finds a GameObject in the scene and selects it in the editor
go static String SaveFileDialog(String title, String extension, String defaultPath) Open a file save dialog. Returns null on cancel, else the absolute path of the target file.
static String OpenFileDialog(String title, String extension, String defaultPath) Open a file open dialog. Returns null on cancel, else the absolute path of the target file.
static T LoadProjectSettings(String filename) Load a project settings file
static Void SaveProjectSettings(T data, String filename) Save a project settings file