[FilePath]

Displays a string field with a file browser button.

Support Types

Type
Description

string

File path string

Parameters

Parameter Name
Arguments
Description

Title

string

File panel title.

Directory

string

Start panel directory.

Extension

string

File extension filter.

RelativePath

bool

Convert path to project relative. Only if selected file inside Assets folder.

Examples

using UnityEngine;
using RenownedGames.Apex;

public class FilePathExample : MonoBehaviour
{
    [FilePath]
    public string anyFile;

    [FilePath(Extension = "png")]
    public string imagePath;

    [FilePath(Title = "Select Config", Directory = "Assets/Configs", RelativePath = true)]
    public string configPath;
}

Last updated