Show / Hide Table of Contents

Class RuntimeProfile

The Runtime Profile manages Options and their initial values when playing the project in the editor or in a build.

Inheritance
System.Object
RuntimeProfile
Implements
System.Collections.Generic.IEnumerable<Option>
System.Collections.IEnumerable
Namespace: sttz.Trimmer
Assembly: Trimmer.dll
Syntax
public class RuntimeProfile : IEnumerable<Option>, IEnumerable
Remarks

The profile can be enumerated to access the individual Options.

In case no Options are included in a build, Trimmer will be completely removed and the RuntimeProfile class will not be available in builds. Use the NO_TRIMMER compilation symbol to check if Trimmer will be removed.

Constructors

| Improve this Doc View Source

RuntimeProfile()

Create a new profile without any defaults.

Declaration
public RuntimeProfile()
| Improve this Doc View Source

RuntimeProfile(ValueStore)

Create a new profile with given defaults.

Declaration
public RuntimeProfile(ValueStore store)
Parameters
Type Name Description
ValueStore store

Fields

| Improve this Doc View Source

options

Options sorted by ApplyOrder.

Declaration
protected List<Option> options
Field Value
Type Description
System.Collections.Generic.List<Option>
| Improve this Doc View Source

optionsByName

Options by name.

Declaration
protected Dictionary<string, Option> optionsByName
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, Option>
| Improve this Doc View Source

TRIMMER_VERSION

Current version of the Trimmer framework.

Declaration
public static readonly Version TRIMMER_VERSION
Field Value
Type Description
Version

Properties

| Improve this Doc View Source

AllOptionTypes

All available Options types.

Declaration
public static IEnumerable<Type> AllOptionTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>
Remarks

This property will include all Options in the editor but only the included Options in builds.

| Improve this Doc View Source

Main

Main runtime profile.

Declaration
public static RuntimeProfile Main { get; protected set; }
Property Value
Type Description
RuntimeProfile
Remarks

The main runtime profile is available while playing in the editor, during building when post-processing scenes and in the player if any Options have been included.

| Improve this Doc View Source

Store

Values used for this profile.

Declaration
public virtual ValueStore Store { get; set; }
Property Value
Type Description
ValueStore
Remarks

Setting the store causes all Options' value to be reset to the values from the store, Options for which no value is defined in the store are reset to their default value. Setting the store will not apply the Options.

Methods

| Improve this Doc View Source

Apply()

Apply the profile, i.e. apply all Options it contains.

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

CleanStore()

Remove all entries from the store that don't have a matching Option instance.

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

CleanStoreRecursive(ValueStore.Node, Option, Boolean)

Declaration
protected void CleanStoreRecursive(ValueStore.Node node, Option option, bool isDefaultNode = false)
Parameters
Type Name Description
ValueStore.Node node
Option option
System.Boolean isDefaultNode
| Improve this Doc View Source

Clear()

Clear the profile, resetting all Options to their default values.

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

CreateMain(ValueStore)

Create the main runtime profile with the given value store.

Declaration
public static void CreateMain(ValueStore store)
Parameters
Type Name Description
ValueStore store
Remarks

This method is automatically called by BuildManager and ProfileContainer and should not be called manually.

| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator<Option> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<Option>
| Improve this Doc View Source

GetOption(String)

Try to find an option by its path, allowing to get nested child and variant options.

Declaration
public Option GetOption(string path)
Parameters
Type Name Description
System.String path
Returns
Type Description
Option
Remarks

Use Path to get the path of an existing Option that can then be used with this method.

| Improve this Doc View Source

GetRootOption(String)

Get a main Option by name (no nested child or variant Options).

Declaration
public Option GetRootOption(string name)
Parameters
Type Name Description
System.String name
Returns
Type Description
Option
| Improve this Doc View Source

Load()

Load the data in the store into the Option instances.

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

ParseParameter(ref String, out String)

Declaration
protected void ParseParameter(ref string part, out string parameter)
Parameters
Type Name Description
System.String part
System.String parameter
| Improve this Doc View Source

SaveToStore(Boolean)

Save the Options' current values to the store.

Declaration
public void SaveToStore(bool clear = true)
Parameters
Type Name Description
System.Boolean clear
Remarks

The store will be cleared of all entries with no matching Option instance.

| Improve this Doc View Source

ShouldCreateOption(Type)

Limit the Options the profile creates.

Declaration
protected virtual bool ShouldCreateOption(Type optionType)
Parameters
Type Name Description
System.Type optionType
Returns
Type Description
System.Boolean

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

Extensions.IterateWith<TFirst, TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>)
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz