Exemplo n.º 1
0
 private void InitGameObject(string gameObjectName)
 {
     DeInitGameObject(gameObjectName);
     _CallbackGameObject = new GameObject(gameObjectName);
     _CallbackQueue      = _CallbackGameObject.AddComponent <AgoraCallbackQueue>();
     GameObject.DontDestroyOnLoad(_CallbackGameObject);
     _CallbackGameObject.hideFlags = HideFlags.HideInHierarchy;
 }
Exemplo n.º 2
0
 public void Release()
 {
     if (!ReferenceEquals(_CallbackGameObject, null))
     {
         if (!ReferenceEquals(_CallbackQueue, null))
         {
             _CallbackQueue.ClearQueue();
         }
         GameObject.Destroy(_CallbackGameObject);
         _CallbackGameObject = null;
         _CallbackQueue      = null;
     }
 }
Exemplo n.º 3
0
        private void DeInitGameObject(string gameObjectName)
        {
            GameObject gameObject = GameObject.Find(gameObjectName);

            if (!ReferenceEquals(gameObject, null))
            {
                AgoraCallbackQueue callbackQueue = gameObject.GetComponent <AgoraCallbackQueue>();
                if (!ReferenceEquals(callbackQueue, null))
                {
                    callbackQueue.ClearQueue();
                }
                GameObject.Destroy(gameObject);
                gameObject    = null;
                callbackQueue = null;
            }
        }