Search Results for

    Show / Hide Table of Contents

    Class Prefs<T>

    Wrapper for Unity's PlayerPrefs with type safety and serialization support. This class allows you to store and retrieve various types of data in PlayerPrefs, while ensuring type safety and automatic serialization/deserialization.

    Inheritance
    object
    Prefs<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9
    Assembly: Glitch9.dll
    Syntax
    public class Prefs<T>
    Type Parameters
    Name Description
    T

    The type of the value to be stored in PlayerPrefs. Supported types include: int, float, string, bool, UnixTime, Vector2, Vector3, Quaternion, and more.

    Constructors

    | Edit this page View Source

    Prefs(string, T)

    Declaration
    public Prefs(string prefsKey, T defaultValue)
    Parameters
    Type Name Description
    string prefsKey
    T defaultValue

    Properties

    | Edit this page View Source

    Value

    Declaration
    public T Value { get; set; }
    Property Value
    Type Description
    T

    Methods

    | Edit this page View Source

    Clear()

    Declaration
    public void Clear()

    Operators

    | Edit this page View Source

    implicit operator T(Prefs<T>)

    Declaration
    public static implicit operator T(Prefs<T> prefs)
    Parameters
    Type Name Description
    Prefs<T> prefs
    Returns
    Type Description
    T

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation