Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
        }