Esempio n. 1
0
 public void ClearObject(GameObjectPusher pusher)
 {
     if (m_objectGroupDictionary.ContainsKey(pusher.Key))
     {
         m_objectGroupDictionary.Remove(pusher.Key);
     }
 }
Esempio n. 2
0
        public void PushObject(GameObjectPusher pusher)
        {
            if (pusher.OverrideObject && m_objectGroupDictionary.ContainsValue(pusher.ObjectToPush))
            {
                string key = m_objectGroupDictionary.FirstOrDefault(pair => pair.Value == pusher.ObjectToPush).Key;
                m_objectGroupDictionary.Remove(key);
            }

            m_objectGroupDictionary.Add(pusher.Key, pusher.ObjectToPush);
            if (m_ObjectPullerDictionary.TryGetValue(pusher.Key, out var pullersList))
            {
                pullersList.ForEach(puller => puller.Set(pusher.ObjectToPush));
                m_ObjectPullerDictionary.Remove(pusher.Key);
            }
        }