Class FileNameGenerator
Namespace: UnityEditor.Recorder
Syntax
[Serializable]
public class FileNameGenerator
Properties
FileName
Stores the default set of tags that make up the output file name.
Declaration
public string FileName { get; set; }
Property Value
Type | Description |
---|---|
String |
ForceAssetsFolder
Use this property to ensure that the generated file is saved in the Assets folder.
Declaration
public bool ForceAssetsFolder { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Leaf
Indicates the filename part of the full path (without the extension).
Declaration
public string Leaf { get; set; }
Property Value
Type | Description |
---|---|
String |
Root
Indicates the root location the paths are relative to.
Declaration
public OutputPath.Root Root { get; set; }
Property Value
Type | Description |
---|---|
OutputPath.Root |
Methods
AddWildcard(String, Func<RecordingSession, String>)
Adds a tag and the corresponding callback to resolve it.
Declaration
public void AddWildcard(string tag, Func<RecordingSession, string> resolver)
Parameters
Type | Name | Description |
---|---|---|
String | tag | The tag string. |
Func<RecordingSession, String> | resolver | Callback invoked to replace the tag with custom content. |
BuildAbsolutePath(RecordingSession)
Builds an absolute path from the list of configured output file tags replaced by the RecordingSession.
Declaration
public string BuildAbsolutePath(RecordingSession session)
Parameters
Type | Name | Description |
---|---|---|
RecordingSession | session | The Recorder session used to replace the tags. |
Returns
Type | Description |
---|---|
String | An absolute path towards a file. |
CreateDirectory(RecordingSession)
Creates the directory structure containing the output file from the list of tags and a RecordingSession.
Declaration
public void CreateDirectory(RecordingSession session)
Parameters
Type | Name | Description |
---|---|---|
RecordingSession | session | The Recorder session. |
SanitizePath(String)
Makes the output file path compliant with any OS (replacing any "" by "/").
Declaration
public static string SanitizePath(string fullPath)
Parameters
Type | Name | Description |
---|---|---|
String | fullPath |
Returns
Type | Description |
---|---|
String | The full path with slashes "/" as file separators. |