Show / Hide Table of Contents

Class OptionIniFile

Load an ini file in the player to change option values.

Inheritance
System.Object
Option
Option<System.String>
OptionString
OptionIniFile
Inherited Members
OptionString.EditGUI()
OptionString.Parse(String)
OptionString.Load(String)
OptionString.Save(String)
OptionString.Save()
Option<String>.Value
Option<String>.DefaultValue
Option.DEFINE_PREFIX
Option.OPTION_PREFIX
Option.changed
Option.Capabilities
Option.SupportedTargets
Option.IsAvailable(IEnumerable<BuildTarget>)
Option.ShouldIncludeOnlyFeature()
Option.PostprocessScene(Scene, OptionInclusion)
Option.PostprocessOrder
Option.PrepareBuild(BuildPlayerOptions, OptionInclusion)
Option.PreprocessBuild(BuildTarget, String, OptionInclusion)
Option.PostprocessBuild(BuildTarget, String, OptionInclusion)
Option.GetScriptingDefineSymbols(OptionInclusion, HashSet<String>)
Option.Name
Option.Parent
Option.Path
Option.GetPathRecursive(Option)
Option.InvalidatePathRecursive()
Option.ApplyOrder
Option.ApplyFromRoot()
Option.Variance
Option.VariantParameter
Option.VariantDefaultParameter
Option.IsDefaultVariant
Option.Variants
Option.AddVariant(String)
Option.GetVariant(String, Boolean)
Option.RemoveVariant(Option)
Option.ClearVariants()
Option.RenumberArrayVariants()
Option.HasChildren
Option.Children
Option.CreateChildren()
Option.GetChild(String)
Option.GetChild<TOption>()
Option.Category
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 Source

Apply()

Declaration
public override void Apply()
Overrides
Option.Apply()
| Improve this Doc View Source

Configure()

Declaration
protected override void Configure()
Overrides
Option.Configure()
| Improve this Doc View Source

ExpandPath(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
| Improve this Doc View Source

LoadIniFile()

Look for an ini file in the configured search path(s).

Declaration
public void LoadIniFile()
| Improve this Doc View Source

LoadIniFile(String)

Load an ini file from the given path.

Declaration
public void LoadIniFile(string path)
Parameters
Type Name Description
System.String path
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz