コード例 #1
0
 private void InitGameObject(string gameObjectName)
 {
     DeInitGameObject(gameObjectName);
     _CallbackGameObject = new GameObject(gameObjectName);
     _CallbackQueue      = new AgoraCallbackQueue();
     GameObject.DontDestroyOnLoad(_CallbackGameObject);
 }
コード例 #2
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;
            }
        }