예제 #1
0
    protected override IEnumerator runTest()
    {
        yield return(StartCoroutine(base.runTest()));

        backButtonController = Service.Get <BackButtonController>();
        backButtonController.Add(Level1BackCallback);
        IntegrationTestEx.FailIf(backButtonController.NumCallbacks() != 1, "FAILED: Level 1 back button controller not properly added.");
        level1ExpectedCallback.Add(Level1BackCallback);
        backButtonController.Execute();
        backButtonController.Add(Level2aBackCallback);
        backButtonController.Add(Level2bBackCallback);
        IntegrationTestEx.FailIf(backButtonController.NumCallbacks() != 2, "FAILED: Level 2 back button controller not properly added.");
        level2ExpectedCallbacks.Add(Level2aBackCallback);
        level2ExpectedCallbacks.Add(Level2bBackCallback);
        backButtonController.Execute();
        backButtonController.Execute();
        backButtonController.Add(Level3aBackCallback);
        backButtonController.Add(Level3bBackCallback);
        backButtonController.Add(Level3cBackCallback);
        IntegrationTestEx.FailIf(backButtonController.NumCallbacks() != 3, "FAILED: Level 3 back button controller not properly added.");
        level3ExpectedCallbacks.Add(Level3aBackCallback);
        level3ExpectedCallbacks.Add(Level3bBackCallback);
        level3ExpectedCallbacks.Add(Level3cBackCallback);
        backButtonController.Execute();
        backButtonController.Execute();
        backButtonController.Execute();
        backButtonController.Add(TestRemovingACallback);
        backButtonController.Remove(TestRemovingACallback);
        IntegrationTestEx.FailIf(backButtonController.NumCallbacks() > 0, "FAILED: callback not removed from back button controller.");
        backButtonController.Add(null);
        backButtonController.Remove(null, invokeRemovedCallback: true);
        IntegrationTestEx.FailIf(backButtonController.NumCallbacks() > 0, "FAILED: Null callback not removed from back button controller.");
    }
예제 #2
0
 private void addBackButtonHandler()
 {
     if (backButtonController != null)
     {
         backButtonController.Add(onAndroidBackButtonClicked);
     }
 }
 private void OnEnable()
 {
     backButtonController.Add(onRootLevelBackButtonClicked);
     backButtonController.rootLevelBackAction = this;
 }