first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace NitroxClient.MonoBehaviours;
public class ReferenceHolder : MonoBehaviour
{
private readonly Dictionary<Type, object> references = [];
public bool TryGetReference<T>(out T outReference)
{
if (references.TryGetValue(typeof(T), out object value) && value is T reference)
{
outReference = reference;
return true;
}
outReference = default;
return false;
}
public void AddReference<T>(T reference)
{
references[typeof(T)] = reference;
}
}