docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SessionState<T>

    Wrapper utility around SessionState to allow saving arbitrary data for a given session.

    Inheritance
    object
    SessionState<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Behavior.Serialization.Editor
    Assembly: Unity.Behavior.Serialization.Editor.dll
    Syntax
    public static class SessionState<T> where T : class, new()
    Type Parameters
    Name Description
    T

    The type of the session state data

    Methods

    Clear(string)

    Clears the data stored at the provided key.

    Declaration
    public static void Clear(string key)
    Parameters
    Type Name Description
    string key

    The key to the data.

    GetOrCreate(string)

    Returns an instance of T for the provided key.

    Declaration
    public static T GetOrCreate(string key)
    Parameters
    Type Name Description
    string key

    The key to the data.

    Returns
    Type Description
    T

    The T instance.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)