Skip to content

Instantly share code, notes, and snippets.

@hasanbayatme
hasanbayatme / GlobalVariables.cs
Last active November 17, 2023 09:14
A simple C# static class to get and set globally accessible variables through a key-value approach (C#, Unity, .NET)
using System.Collections.Generic;
/// <summary>
/// A simple static class to get and set globally accessible variables through a key-value approach.
/// </summary>
/// <remarks>
/// <para>Uses a key-value approach (dictionary) for storing and modifying variables.</para>
/// <para>It also uses a lock to ensure consistency between the threads.</para>
/// </remarks>
public static class GlobalVariables