예제 #1
0
    private void OnDestroy()
    {
        if (sceneToEdit != null)
        {
            sceneToEdit.OnLoadingStateUpdated -= UpdateSceneLoadingProgress;
        }

        Environment.i.world.sceneController.OnNewSceneAdded -= NewSceneAdded;
        Environment.i.world.sceneController.OnReadyScene    -= NewSceneReady;

        KernelConfig.i.OnChange -= OnKernelConfigChanged;

        if (HUDController.i.builderInWorldInititalHud != null)
        {
            HUDController.i.builderInWorldInititalHud.OnEnterEditMode -= TryStartEnterEditMode;
        }

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnTutorialAction -= StartTutorial;
            HUDController.i.builderInWorldMainHud.OnLogoutAction   -= ExitEditMode;
        }

        if (initialLoadingController != null)
        {
            initialLoadingController.OnCancelLoading -= CancelLoading;
            initialLoadingController.Dispose();
        }

        BuilderInWorldNFTController.i.OnNFTUsageChange -= OnNFTUsageChange;
        CleanItems();
    }
    public override void Dispose()
    {
        base.Dispose();

        if (userProfile != null)
        {
            userProfile.OnUpdate -= OnUserProfileUpdate;
        }

        CoroutineStarter.Stop(updateLandsWithAcessCoroutine);

        if (sceneToEdit != null)
        {
            sceneToEdit.OnLoadingStateUpdated -= UpdateSceneLoadingProgress;
        }

        Environment.i.world.sceneController.OnNewSceneAdded -= NewSceneAdded;
        Environment.i.world.sceneController.OnReadyScene    -= NewSceneReady;


        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnTutorialAction  -= StartTutorial;
            HUDController.i.builderInWorldMainHud.OnStartExitAction -= StartExitMode;
            HUDController.i.builderInWorldMainHud.OnLogoutAction    -= ExitEditMode;
        }

        BIWTeleportAndEdit.OnTeleportEnd -= OnPlayerTeleportedToEditScene;

        if (initialLoadingController != null)
        {
            initialLoadingController.Dispose();
        }


        BIWNFTController.i.OnNFTUsageChange           -= OnNFTUsageChange;
        builderInWorldBridge.OnCatalogHeadersReceived -= CatalogHeadersReceived;
        builderInWorldBridge.OnBuilderProjectInfo     -= BuilderProjectPanelInfo;
        CleanItems();

        HUDController.i.OnBuilderProjectPanelCreation -= InitBuilderProjectPanel;
        editModeChangeInputAction.OnTriggered         -= ChangeEditModeStatusByShortcut;

        if (biwAudioHandler.gameObject != null)
        {
            GameObject.Destroy(biwAudioHandler.gameObject);
        }

        foreach (var controller in controllers)
        {
            controller.Dispose();
        }

        context.Dispose();
    }
예제 #3
0
    private void OnDestroy()
    {
        KernelConfig.i.OnChange -= OnKernelConfigChanged;

        if (HUDController.i.builderInWorldInititalHud != null)
        {
            HUDController.i.builderInWorldInititalHud.OnEnterEditMode -= TryStartEnterEditMode;
        }

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnTutorialAction -= StartTutorial;
            HUDController.i.builderInWorldMainHud.OnLogoutAction   -= ExitEditMode;
        }

        if (initialLoadingController != null)
        {
            initialLoadingController.OnCancelLoading -= ExitEditMode;
            initialLoadingController.Dispose();
        }

        BuilderInWorldNFTController.i.OnNFTUsageChange -= OnNFTUsageChange;
        CleanItems();
    }