docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FileNameGenerator

    A class that provides a way to generate names of output files, with support for wildcards.

    Inheritance
    object
    FileNameGenerator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Recorder
    Assembly: Unity.Recorder.Editor.dll
    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

    Specifies whether the generated file is saved in the Assets folder or not.

    Declaration
    public bool ForceAssetsFolder { get; set; }
    Property Value
    Type Description
    bool

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)