Class PathUtility | Anime Toolbox | 0.4.0-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class PathUtility

    A utility class for executing path-related operations.

    Inheritance
    Object
    PathUtility
    Namespace: Unity.AnimeToolbox
    Syntax
    public static class PathUtility

    Methods

    GenerateUniqueFolder(String)

    Generate a unique folder by trying with the passed parameter as the first candidate. "/foo/bar": will generate "/foo/bar" if the directory didn't exist. "/foo/bar": will generate "/foo/bar 1"" if the directory already existed.

    Declaration
    public static string GenerateUniqueFolder(string folder)
    Parameters
    Type Name Description
    String folder

    The first candidate of the folder to create

    Returns
    Type Description
    String

    The path to the created folder

    GetDirectoryName(String, Int32)

    Get the directory name of the path n-levels up Ex: n=1. Assets/Scripts/Foo.cs => Assets/Scripts n=2. Assets/Scripts/Foo.cs => Assets

    Declaration
    public static string GetDirectoryName(string path, int n = 1)
    Parameters
    Type Name Description
    String path

    the base path

    Int32 n

    how many levels up

    Returns
    Type Description
    String

    the directory name

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023