Пример #1
0
        public GameObject getConnection(IDPair key)
        {
            GameObject result;
            bool       check = pool.TryGetValue(key, out result);

            if (check == false)
            {
                IDPair reverseConnection = new IDPair(key.ID_ConnectionPoint_B, key.ID_ConnectionPoint_A);
                check = pool.TryGetValue(reverseConnection, out result);
            }
            return(result);
        }
Пример #2
0
        public void AddConnection(IDPair key, GameObject connection)
        {
            bool   check             = pool.ContainsKey(key);
            IDPair reverseConnection = new IDPair(key.ID_ConnectionPoint_B, key.ID_ConnectionPoint_A);
            bool   reverseCheck      = pool.ContainsKey(reverseConnection);

            if (check == false && reverseCheck == false)
            {
                pool.Add(key, connection);
            }

            return;
        }