johnlondergan
New member
Does this allocate on all gameobjects globally?
namespace Opsive.Shared.Game
{
public static class GameObjectExtensions
{
private static Dictionary<GameObject, Dictionary<Type, object>> s_GameObjectComponentMap = new Dictionary<GameObject, Dictionary<Type, object>>();
private static Dictionary<GameObject, Dictionary<Type, object>> s_GameObjectParentComponentMap = new Dictionary<GameObject, Dictionary<Type, object>>();
private static Dictionary<GameObject, Dictionary<Type, object>> s_GameObjectInactiveParentComponentMap = new Dictionary<GameObject, Dictionary<Type, object>>();
private static Dictionary<GameObject, Dictionary<Type, object[]>> s_GameObjectComponentsMap = new Dictionary<GameObject, Dictionary<Type, object[]>>();
private static Dictionary<GameObject, Dictionary<Type, object[]>> s_GameObjectParentComponentsMap = new Dictionary<GameObject, Dictionary<Type, object[]>>();
public static T GetCachedComponent<T>(this GameObject gameObject)
{