Esempio n. 1
0
        static void AddToCache(GameObject key, Bubble bubble)
        {
            if (Cache == null)
            {
                Cache = new Dictionary <GameObject, Bubble>();
            }

            if (Cache.ContainsKey(key))
            {
                return;
            }

            Cache.Add(key, bubble);
        }
Esempio n. 2
0
        void TryRemoveConnectedBubble(Bubble bubble)
        {
            if (!bubble)
            {
                return;
            }

            if (!CheckConnectedBubble(bubble))
            {
                return;
            }

            _connectedBubbles.Remove(bubble);
        }
Esempio n. 3
0
        bool CheckAllConnectedBubble(Bubble bubble)
        {
            if (CheckConnectedBubble(bubble))
            {
                return(true);
            }

            foreach (var curBubble in _connectedBubbles)
            {
                if (curBubble.CheckConnectedBubble(bubble))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 4
0
        void TryAddConnectedBubble(Bubble bubble)
        {
            if (!bubble)
            {
                return;
            }

            if ((bubble._bubbleTag != _bubbleTag) || (bubble == this))
            {
                return;
            }

            if (CheckAllConnectedBubble(bubble))
            {
                return;
            }

            _connectedBubbles.Add(bubble);
        }
Esempio n. 5
0
 bool CheckConnectedBubble(Bubble bubble)
 {
     return(_connectedBubbles.IndexOf(bubble) != -1);
 }