Exemple #1
0
        private static void DisposingSlot(object[] parameters)
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log("AudioPlayerMapper>DisposingSlot");
            }
#endif
            _mappers.Clear();
            _defaultMapper = null;
            _initialized   = false;
        }
Exemple #2
0
        private static void Initialize()
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log("Initializing AudioPlayerMapper");
            }
#endif
            _mappers = new Dictionary <string, AudioPlayerMapper>();

            Object[] mappers = FindObjectsOfType(typeof(AudioPlayerMapper));

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format("   -> Found {0} AudioPlayerMappers", mappers.Length));
            }
#endif
            foreach (Object o in mappers)
            {
                AudioPlayerMapper mapper = (AudioPlayerMapper)o;

                if (mapper.Default)
                {
                    if (null != _defaultMapper)
                    {
                        Debug.LogWarning("Duplicated default AudioPlayerMapper");
                    }

                    _defaultMapper = mapper;
                }

                if (!string.IsNullOrEmpty(mapper.Id))
                {
                    if (_mappers.ContainsKey(mapper.Id))
                    {
                        Debug.LogWarning("Duplicated AudioPlayerMapper for: " + mapper.Id, mapper);
                    }
                    else
                    {
                        _mappers.Add(mapper.Id, mapper);
                    }
                }
            }

            _initialized = true;
        }
        private static void Initialize()
        {
            #if DEBUG
            if (DebugMode)
            {
                Debug.Log("Initializing AudioPlayerMapper");
            }
            #endif
            _mappers = new Dictionary<string, AudioPlayerMapper>();

            Object[] mappers = FindObjectsOfType(typeof(AudioPlayerMapper));

            #if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format("   -> Found {0} AudioPlayerMappers", mappers.Length));
            }
            #endif
            foreach (Object o in mappers)
            {
                AudioPlayerMapper mapper = (AudioPlayerMapper)o;

                if (mapper.Default)
                {
                    if (null != _defaultMapper)
                        Debug.LogWarning("Duplicated default AudioPlayerMapper");

                    _defaultMapper = mapper;
                }

                if (!string.IsNullOrEmpty(mapper.Id))
                {

                    if (_mappers.ContainsKey(mapper.Id))
                        Debug.LogWarning("Duplicated AudioPlayerMapper for: " + mapper.Id, mapper);
                    else
                        _mappers.Add(mapper.Id, mapper);
                }
            }

            _initialized = true;
        }
 private static void DisposingSlot(object[] parameters)
 {
     #if DEBUG
     if (DebugMode)
     {
         Debug.Log("AudioPlayerMapper>DisposingSlot");
     }
     #endif
     _mappers.Clear();
     _defaultMapper = null;
     _initialized = false;
 }