public static abstract sealed class Editor.EditorUtility
Methods
Showing 55 methods
public static void AddLogger(System.Action`1<Sandbox.LogEvent> logger)
public static Sandbox.ConCmdAttribute.AutoCompleteResult[] AutoComplete(string text, int maxCount)
public 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.
public static void CopyAssetToDirectory(Editor.Asset asset, string directory, bool overwrite = True)
Copies an asset's source and compiled files to a directory (if they exist)
Parameters
overwrite: Default: True
public static Editor.Asset CreateModelFromMeshComponents(Sandbox.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.
public static Editor.Asset CreateModelFromMeshFile(Editor.Asset meshFile, string targetAbsolutePath = null)
Create a vmdl file from a mesh. Will return non null if the asset was created successfully
Parameters
targetAbsolutePath: Default: null
public static Editor.Asset CreateModelFromPolygonMeshes(Sandbox.PolygonMesh[] polygonMeshes, string targetAbsolutePath)
Create a vmdl file from polygon meshes. Will return non null if the asset was created successfully
public static Sandbox.SceneWorld CreateSceneWorld()
public static Sandbox.VideoWriter CreateVideoWriter(string path, Sandbox.VideoWriter.Config config)
Create a video writer
public static Sandbox.WebSurface CreateWebSurface()
Create an unlimited web surface
public static System.IDisposable DisableTextureStreaming()
Force textures to load fully when loading a model etc..
public static System.Threading.Tasks.Task`1<bool> DownloadAsync(string url, string targetfile, Sandbox.Utility.DataProgress.Callback progress = null, System.Threading.CancellationToken token = null)
Parameters
progress: Default: nulltoken: Default: null
public static Sandbox.Project FindProjectByDirectory(string fullPath)
Tries to find a project based on a given directory.
public static Editor.Pixmap GetFileThumbnail(string filePath, int width, int height)
public static Sandbox.GameObjectSystem GetGameObjectSystem(Sandbox.Scene scene, Sandbox.TypeDescription fromType)
Gets a GameObjectSystem from its type
public static System.Collections.Generic.HashSet`1<Sandbox.Internal.IPanel> GetRootPanels()
Get all the root panels.
public static string GetSearchPaths()
Gets every search path seperated by ;
public static Sandbox.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.
public static Facepunch.ActionGraphs.ISourceLocation GetSourceLocation(Sandbox.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.
public static bool IsCodeFile(string fullPath)
Checks if a given file is a code file
public static bool IsCodeFolder(string fullPath)
Checks if a given folder is a code folder, e.g. [project root]/Code
public static string KeyValues1ToJson(string kvString)
Some old ass assets are keyvalues (1). Convert them to Json so we can use them.
public static string KeyValues3ToJson(string kvString)
Some assets are kv3, we want to convert them to json
public static Sandbox.Utility.FloatBitmap LoadBitmap(string filename)
Load a float bitmap. This is usually a png, tga, exr, psd
public static T LoadProjectSettings(string filename)
Load a project settings file
public static void MoveAssetToDirectory(Editor.Asset asset, string directory, bool overwrite = True)
Moves an asset's source and compiled files to a directory (if they exist)
Parameters
overwrite: Default: True
public static Editor.Widget OpenControlSheet(Sandbox.SerializedObject so, Editor.Widget parent, bool 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.
Parameters
createWindow: Default: True
public static void OpenFile(string path)
Open a folder (or url)
public 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.
public static void OpenFileFolder(string filepath)
Open given file's folder in OS file explorer and select given file.
public static void OpenFolder(string path)
Open a folder (or url)
public static bool 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
public static Sandbox.SoundHandle PlaySound(string sound, float startTime = 0)
Plays a sound event
Parameters
startTime: Default: 0
public static System.Threading.Tasks.Task`1<bool> PutAsync(System.IO.Stream fileStream, string endpoint, Sandbox.Utility.DataProgress.Callback progress = null, System.Threading.CancellationToken token = null)
Parameters
progress: Default: nulltoken: Default: null
public static void Quit(bool toLauncher = False)
Quit the whole engine
Parameters
toLauncher: Open the launcher on exit, if it's not already open. Default: False
public static void RemoveLogger(System.Action`1<Sandbox.LogEvent> logger)
public static bool RenameAsset(Editor.Asset asset, string newName)
Moves a file to the same directory but gives it a new name
public static void RenameDirectory(string directory, string newDirectory, bool recursive = False)
Parameters
recursive: Default: False
public static void RestartEditor()
Restarts the editor with the same project.
public static void RestartEditorPrompt(string message, string title = Restart Editor)
Open a dialog prompt asking the user to restart the editor.
Parameters
title: Default: Restart Editor
public 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.
public static void SaveProjectSettings(T data, string filename)
Save a project settings file
public static void SendToRecycleBin(string filename)
public static void StopAssetSound()
Stop a sound playing from an asset preview
public static System.Threading.Tasks.Task`1<string> TranslateString(string input, string language)
Translate input into language
No results match this filter.
Properties
Showing 5 properties
public static System.Collections.Generic.IEnumerable`1<string> Editor.EditorUtility.FontFamilies { get; set; }
public static object Editor.EditorUtility.InspectorObject { get; set; }
Set the object to be inspected by the inspector.
public static bool Editor.EditorUtility.IsRecordingVideo { get; set; }
True if we're currently recording a video (using the video command, or F6)
public static bool Editor.EditorUtility.IsVulkan { get; set; }
Used for shadergraph
public static Sandbox.Engine.Settings.RenderSettings Editor.EditorUtility.RenderSettings { get; set; }
Access to the client's render settings
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Editor |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.EditorUtility |