public static void RemoveMonoContext(GameObject gameObject) { MonoContext c = null; if (s_MonoContexts.TryGetValue(gameObject, out c)) { c.enable = false; s_MonoContexts.Remove(gameObject); s_MonoContextPool.Release(c); } }
public static MonoContext GetMonoContext(GameObject gameObject) { MonoContext c = null; if (!s_MonoContexts.TryGetValue(gameObject, out c)) { c = s_MonoContextPool.Get(); c.target = gameObject; s_MonoContexts[gameObject] = c; } return(c); }