예제 #1
0
 public void UnRegisterActivityResultHandler(int requestCode, OnActivityResultDelegate handler)
 {
     if (m_ActivityResultHandlers != null && m_ActivityResultHandlers.ContainsKey(requestCode))
     {
         List <OnActivityResultDelegate> handlers = m_ActivityResultHandlers[requestCode];
         if (handlers.Contains(handler))
         {
             handlers.Remove(handler);
         }
     }
 }
예제 #2
0
        public void RegisterActivityResultHandler(int requestCode, OnActivityResultDelegate handler)
        {
            if (m_ActivityResultHandlers == null)
            {
                m_ActivityResultHandlers = new Dictionary <int, List <OnActivityResultDelegate> >();
            }
            if (!m_ActivityResultHandlers.ContainsKey(requestCode))
            {
                m_ActivityResultHandlers[requestCode] = new List <OnActivityResultDelegate>();
            }

            if (!m_ActivityResultHandlers[requestCode].Contains(handler))
            {
                m_ActivityResultHandlers[requestCode].Add(handler);
            }
        }