Class OptionIniFile
Load an ini file in the player to change option values.
Inherited Members
Namespace: sttz.Trimmer.Options
Assembly: Trimmer.dll
Syntax
[Capabilities(OptionCapabilities.CanIncludeOption)]
public class OptionIniFile : OptionString
Remarks
Using a ini file is the easiest way to tweak options in a build player
since it doesn't require any in-game interface. Ini files are easy to
edit and allow to easily enable debug options or tweak the behaviour
without having to rebuild.
The main option configures the file name of the ini file. The extension
doesn't need to be «ini», it could also be «txt» to make editing easier.
The child option OptionIniFile.OptionSearchPath controls where the ini
is loaded from. It's a list of paths separated by «;». The paths are
searched in order and the first file matching the file name is loaded.
Search paths can contain relative paths, in which case they are resolved
relative to the player.
Search paths support a few expansions for varying directory paths:
%DataPath%
is replaced by Application.dataPath
%PersistentDataPath%
is replaced by Application.persistentDataPath
%Personal%
is replaced by Environment.SpecialFolder.Personal
%Desktop%
is replaced by Environment.SpecialFolder.DesktopDirectory
Methods
| Improve this Doc View SourceApply()
Declaration
public override void Apply()
Overrides
| Improve this Doc View SourceConfigure()
Declaration
protected override void Configure()
Overrides
| Improve this Doc View SourceExpandPath(String)
Replace special variables in a ini file path.
Declaration
public string ExpandPath(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path |
Returns
Type | Description |
---|---|
System.String |
LoadIniFile()
Look for an ini file in the configured search path(s).
Declaration
public void LoadIniFile()
LoadIniFile(String)
Load an ini file from the given path.
Declaration
public void LoadIniFile(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path |