Search Results for

    Show / Hide Table of Contents

    Class VariablesSource

    Use this class to define variables for other components to use. Use AddVariable(String), RemoveVariable(String) and SetVariable(String, String) to manage variables in the source. Any class can register to the VariablesService to get notified of changes to variables.!-- Changes to variable values should happen through the VariableSource that defines the variable.

    Inheritance
    Object
    VariablesSource
    Implements
    IVariableSource
    IVariablesServiceComponent
    IServiceComponent<VariablesService>
    Namespace: NoSuchStudio.Variables
    Assembly: NoSuchStudio-Variables.dll
    Syntax
    [ExecuteInEditMode]
    public class VariablesSource : NoSuchMonoBehaviour, IVariableSource, IVariablesServiceComponent, IServiceComponent<VariablesService>, ISerializationCallbackReceiver

    Fields

    _changedVariables

    Declaration
    [NonSerialized]
    protected HashSet<string> _changedVariables
    Field Value
    Type Description
    HashSet<String>

    _connected

    Declaration
    [NonSerialized]
    protected Dictionary<Type, bool> _connected
    Field Value
    Type Description
    Dictionary<Type, Boolean>

    _dataChanged

    Declaration
    [NonSerialized]
    protected bool _dataChanged
    Field Value
    Type Description
    Boolean

    Properties

    mono

    Declaration
    public MonoBehaviour mono { get; }
    Property Value
    Type Description
    UnityEngine.MonoBehaviour

    variables

    Declaration
    public Dictionary<string, string> variables { get; }
    Property Value
    Type Description
    Dictionary<String, String>

    Methods

    AddVariable(String)

    Declaration
    public bool AddVariable(string variable)
    Parameters
    Type Name Description
    String variable
    Returns
    Type Description
    Boolean

    Connect<ST>()

    Declaration
    public void Connect<ST>()
    
        where ST : Service<ST>
    Type Parameters
    Name Description
    ST

    Disconnect<ST>()

    Declaration
    public void Disconnect<ST>()
    
        where ST : Service<ST>
    Type Parameters
    Name Description
    ST

    GetVariable(String)

    Declaration
    public string GetVariable(string variable)
    Parameters
    Type Name Description
    String variable
    Returns
    Type Description
    String

    IsConnected<ST>()

    Declaration
    public bool IsConnected<ST>()
    
        where ST : Service<ST>
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    ST

    OnAfterDeserialize()

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Declaration
    public void OnBeforeSerialize()

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    RemoveVariable(String)

    Declaration
    public bool RemoveVariable(string variable)
    Parameters
    Type Name Description
    String variable
    Returns
    Type Description
    Boolean

    SetVariable(String, String)

    Declaration
    public bool SetVariable(string variable, string value)
    Parameters
    Type Name Description
    String variable
    String value
    Returns
    Type Description
    Boolean

    Update()

    Declaration
    protected void Update()

    Implements

    IVariableSource
    IVariablesServiceComponent
    IServiceComponent<>
    In This Article
    Back to top Generated by DocFX