Search Results for

    Show / Hide Table of Contents

    Class Platform

    A collection of platform related helper utilities.

    Inheritance
    System.Object
    Platform
    Namespace: GDX
    Syntax
    [VisualScriptingCompatible((short)8)]
    public static class Platform

    Fields

    | Improve this Doc View Source

    CharacterPoolLength

    Declaration
    public const int CharacterPoolLength = 25
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    CharacterPoolLengthExclusive

    Declaration
    public const int CharacterPoolLengthExclusive = 24
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    DoubleTolerance

    Declaration
    public const double DoubleTolerance = 1E-06
    Field Value
    Type Description
    System.Double
    | Improve this Doc View Source

    FilenameTimestampFormat

    A filename safe version of the timestamp format.

    Declaration
    public const string FilenameTimestampFormat = "yyyyMMdd_HHmmss"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    FloatTolerance

    Declaration
    public const float FloatTolerance = 1E-06F
    Field Value
    Type Description
    System.Single
    | Improve this Doc View Source

    ImageCompareTolerance

    Declaration
    public const float ImageCompareTolerance = 0.99F
    Field Value
    Type Description
    System.Single
    | Improve this Doc View Source

    SafeCharacterPool

    Declaration
    public const string SafeCharacterPool = "abcdefghijklmnopqrstuvwxyz"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TimestampFormat

    Declaration
    public const string TimestampFormat = "yyyy-MM-dd HH:mm:ss"
    Field Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    EnsureFileFolderHierarchyExists(String)

    Validate that all parent directories are created for a given filePath.

    Declaration
    public static void EnsureFileFolderHierarchyExists(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The path to process and validate.

    | Improve this Doc View Source

    EnsureFileWritable(String)

    Validate that the file path is writable, making the necessary folder structure and setting permissions.

    Declaration
    public static void EnsureFileWritable(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The absolute path to validate.

    | Improve this Doc View Source

    EnsureFolderHierarchyExists(String)

    Validate that all directories are created for a given folderPath.

    Declaration
    public static void EnsureFolderHierarchyExists(string folderPath)
    Parameters
    Type Name Description
    System.String folderPath

    The path to process and validate.

    | Improve this Doc View Source

    ForceDeleteFile(String)

    Use our best attempt to remove a file at the designated filePath.

    Declaration
    public static void ForceDeleteFile(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path to remove forcefully.

    | Improve this Doc View Source

    GetHardwareGeneration()

    Gets the current platforms hardware generation number?

    Declaration
    public static int GetHardwareGeneration()
    Returns
    Type Description
    System.Int32

    Returns 0 for base hardware, 1 for updates.

    | Improve this Doc View Source

    GetOutputFolder(String)

    Returns a runtime writable folder.

    Declaration
    public static string GetOutputFolder(string folderName = null)
    Parameters
    Type Name Description
    System.String folderName

    An optional additional folder under the provided path that will be created if necessary.

    Returns
    Type Description
    System.String

    The full path to a writable folder at runtime.

    Remarks

    Depending on the platform, different routes are taken to finding a writable folder.

    EditorThe project's root folder is used in this case.
    Standard PlayerUtilizes UnityEngine.Application.persistentDataPath to find a suitable place.
    DOTS RuntimeUses System.IO.Directory.GetCurrentDirectory.
    The path can be overridden by assigning GDX_OUTPUT_FOLDER in the launching arguments.
    | Improve this Doc View Source

    GetRandomSafeCharacter(IRandomProvider)

    Declaration
    public static char GetRandomSafeCharacter(IRandomProvider random)
    Parameters
    Type Name Description
    IRandomProvider random
    Returns
    Type Description
    System.Char
    | Improve this Doc View Source

    GetUniqueOutputFilePath(String, String, String)

    Declaration
    public static string GetUniqueOutputFilePath(string prefix = "GDX_", string extension = ".log", string folderName = null)
    Parameters
    Type Name Description
    System.String prefix
    System.String extension
    System.String folderName
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    IsFileWritable(String)

    Is it safe to write to the indicated filePath?

    Declaration
    public static bool IsFileWritable(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path to check if it can be written.

    Returns
    Type Description
    System.Boolean

    true/false if the path can be written too.

    | Improve this Doc View Source

    IsFocused()

    Is the application focused?

    Declaration
    public static bool IsFocused()
    Returns
    Type Description
    System.Boolean

    true/false if the application has focus.

    Remarks

    There are issues on some platforms with getting an accurate reading.

    Exceptions
    Type Condition
    UnsupportedRuntimeException

    Not supported on DOTS Runtime.

    | Improve this Doc View Source

    IsHeadless()

    Is the application running in headless mode?.

    Declaration
    public static bool IsHeadless()
    Returns
    Type Description
    System.Boolean

    true/false if the application is without an initialized graphics device.

    Remarks

    Useful for detecting running a server.

    Exceptions
    Type Condition
    UnsupportedRuntimeException

    Not supported on DOTS Runtime.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.