public IEnumerator GameObjectExistsWithNoComponent()
        {
            m_UnityLifecycleManager?.Dispose();
            yield return(null);    //Make sure the above disposed object gets cleaned up properly

            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName), Is.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to be destroyed");
            GameObject dummyCoroutineExecutor = new GameObject(k_CoroutineExecutorGameObjectName);

            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName), Is.Not.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to exists");
            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName).GetComponent <CoroutineExecutor>(), Is.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to be an empty GameObject");
            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName).GetComponent <ApplicationQuit>(), Is.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to be an empty GameObject");
            m_UnityLifecycleManager = new UnityLifecycleManager();
            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName), Is.Not.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to exists");
            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName).GetComponent <CoroutineExecutor>(), Is.Not.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to exists with a CoroutineExecutor MonoBehavior attached to the GameObject");
            Assert.That(GameObject.Find(k_CoroutineExecutorGameObjectName).GetComponent <ApplicationQuit>(), Is.Not.Null, "Expected " + k_CoroutineExecutorGameObjectName + " to exists with a ApplicationQuit MonoBehavior attached to the GameObject");
        }
        public IEnumerator KeepsObjectWhenNewSceneLoaded()
        {
            m_UnityLifecycleManager.Dispose();
            m_UnityLifecycleManager = null;

            var scene = SceneManager.CreateScene("test");

            while (!scene.isLoaded)
            {
                yield return(null);
            }

            SceneManager.SetActiveScene(scene);

            m_UnityLifecycleManager = new UnityLifecycleManager();

            yield return(SceneManager.UnloadSceneAsync(scene));

            Assert.NotNull(GameObject.Find(k_CoroutineExecutorGameObjectName), "Expected " + k_CoroutineExecutorGameObjectName + " to stay when scene unloaded");
        }
 public void TearDown()
 {
     m_UnityLifecycleManager?.Dispose();
     m_UnityLifecycleManager = null;
 }
 public void Setup()
 {
     m_UnityLifecycleManager = new UnityLifecycleManager();
 }
 public IosShowAdOperations(IntPtr placementContentPtr, IUnityLifecycleManager executor) : base(placementContentPtr)
 {
     _executor = executor;
 }
 public IosPromoAdOperations(IntPtr placementContentPtr, IUnityLifecycleManager executor) : base(placementContentPtr, executor)
 {
     metadata = GetMetadataForObjCObject(placementContentPtr);
 }
 public AndroidShowAdCallback(IUnityLifecycleManager callbackExecutor, ShowAdCallbacks?callbacks) : base("com.unity3d.services.monetization.placementcontent.ads.IShowAdListener")
 {
     this.callbackExecutor = callbackExecutor;
     this.callbacks        = callbacks;
 }
 public AndroidShowAdOperations(IUnityLifecycleManager callbackExecutor, AndroidJavaObject javaObject) : base(javaObject)
 {
     this.callbackExecutor = callbackExecutor;
 }
 public AndroidPromoAdOperations(IUnityLifecycleManager callbackExecutor, AndroidJavaObject javaObject) : base(callbackExecutor, javaObject)
 {
     metadata      = GetMetadataForJavaObject(javaObject.Call <AndroidJavaObject>("getMetadata"));
     nativeAdapter = new AndroidJavaObject("com.unity3d.services.monetization.placementcontent.purchasing.NativePromoAdapter", javaObject);
 }
예제 #10
0
 public Banner(INativeBanner nativeBanner, IUnityLifecycleManager unityLifecycleManager)
 {
     m_NativeBanner        = nativeBanner;
     UnityLifecycleManager = unityLifecycleManager;
     m_NativeBanner.SetupBanner(this);
 }