Esempio n. 1
0
        private void RemovePlayerByUserId(uint userId)
        {
            int i = GetPlayerIndexByUserId(userId);

            if (i >= 0)
            {
                m_data.players.RemoveAt(i);
            }

            if (m_mapUserId2Address.ContainsKey(userId))
            {
                m_mapUserId2Address.Remove(userId);
            }
        }
        public static bool Prefix(ref DictionaryExt <GlobalAudioManager.Sounds, GlobalAudioManager.MusicSource> ___s_musicSources,
                                  ref GlobalAudioManager.Sounds ___s_currentMusic)
        {
            string name = SceneManager.GetActiveScene().name;

            for (int i = 0; i < ___s_musicSources.Values.Count; i++)
            {
                var key   = ___s_musicSources.Keys[i];
                var value = ___s_musicSources.Values[i];

                if (key != ___s_currentMusic && value.SceneName != name)
                {
                    if (CustomAudio.ReplacedClips.Contains(key))
                    {
                        //SL.Log("Game tried to clean up " + key + ", but we skipped it!");
                        continue;
                    }

                    UnityEngine.Object.Destroy(value.Source.gameObject);
                    ___s_musicSources.Remove(key);
                    i--;
                }
            }

            return(false);
        }
Esempio n. 3
0
        public void DisposeConnection(uint connId)
        {
            IConnection conn = m_mapConnection[connId];

            if (conn != null)
            {
                m_mapConnection.Remove(connId);
                conn.Dispose();
            }
        }
Esempio n. 4
0
        public static void ReleaseView(EntityObject entity)
        {
            if (entity != null)
            {
                ViewObject obj = mapObjectList[entity];
                if (obj != null)
                {
                    if (EnableLog && MyLogger.EnableLog)
                    {
                        MyLogger.Log(LOG_TAG, "ReleaseView() {0}:{1} -> {2}:{3}",
                                     entity.GetType().Name, entity.GetHashCode(),
                                     obj.GetRecycleType(), obj.GetInstanceID());
                    }

                    mapObjectList.Remove(entity);
                    obj.ReleaseInFactory();
                    obj.gameObject.SetActive(false);

                    //push to recycler
                    objRecycler.Push(obj);
                }
            }
        }