public BuildModeHUDController()
    {
        view = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("BuildModeHUD")).GetComponent <BuildModeHUDView>();

        view.name = "_BuildModeHUD";
        view.gameObject.SetActive(false);

        catalogItemDropController = new CatalogItemDropController();

        buildModeEntityListController = view.GetComponentInChildren <BuilderInWorldEntityListController>();
        buildModeEntityListController = view.entityListController;
        entityInformationController   = view.entityInformationController;

        entityInformationController.OnPositionChange           += (x) => OnSelectedObjectPositionChange?.Invoke(x);
        entityInformationController.OnRotationChange           += (x) => OnSelectedObjectRotationChange?.Invoke(x);
        entityInformationController.OnScaleChange              += (x) => OnSelectedObjectScaleChange?.Invoke(x);
        entityInformationController.OnNameChange               += (entity, newName) => OnEntityRename?.Invoke(entity, newName);
        entityInformationController.OnSmartItemComponentUpdate += (entity) => OnEntitySmartItemComponentUpdate?.Invoke(entity);

        catalogItemDropController.catalogGroupListView = view.catalogGroupListView;
        catalogItemDropController.catalogGroupListView = view.catalogGroupListView;

        buildModeEntityListController.OnEntityClick            += (x) => OnEntityClick(x);
        buildModeEntityListController.OnEntityDelete           += (x) => OnEntityDelete(x);
        buildModeEntityListController.OnEntityLock             += (x) => OnEntityLock(x);
        buildModeEntityListController.OnEntityChangeVisibility += (x) => OnEntityChangeVisibility(x);
        buildModeEntityListController.OnEntityRename           += (entity, newName) => OnEntityRename(entity, newName);

        buildModeEntityListController.CloseList();

        view.OnCatalogItemDrop                += () => catalogItemDropController.CatalogitemDropped();
        view.OnChangeModeAction               += () => OnChangeModeAction?.Invoke();
        view.OnExtraBtnsClick                 += ChangeVisibilityOfExtraBtns;
        view.OnControlsVisibilityAction       += ChangeVisibilityOfControls;
        view.OnChangeUIVisbilityAction        += ChangeVisibilityOfUI;
        view.OnSceneLimitInfoChangeVisibility += ChangeVisibilityOfSceneInfo;
        view.OnSceneLimitInfoControllerChangeVisibilityAction += ChangeVisibilityOfSceneInfo;
        view.OnSceneCatalogControllerChangeVisibilityAction   += ChangeVisibilityOfCatalog;


        view.OnTranslateSelectionAction += () => OnTranslateSelectedAction?.Invoke();
        view.OnRotateSelectionAction    += () => OnRotateSelectedAction?.Invoke();
        view.OnScaleSelectionAction     += () => OnScaleSelectedAction?.Invoke();
        view.OnResetSelectedAction      += () => OnResetAction?.Invoke();
        view.OnDuplicateSelectionAction += () => OnDuplicateSelectedAction?.Invoke();
        view.OnDeleteSelectionAction    += () => OnDeleteSelectedAction?.Invoke();

        catalogItemDropController.OnCatalogItemDropped += CatalogItemSelected;
        view.OnCatalogItemSelected += CatalogItemSelected;
        view.OnStopInput           += () => OnStopInput?.Invoke();
        view.OnResumeInput         += () => OnResumeInput?.Invoke();


        view.OnEntityListChangeVisibilityAction += () => ChangeVisibilityOfEntityList();

        view.OnTutorialAction += () => OnTutorialAction?.Invoke();
        view.OnPublishAction  += () => OnPublishAction?.Invoke();
        view.OnLogoutAction   += () => OnLogoutAction?.Invoke();
    }
Example #2
0
    internal void ConfirmExitModal(BuildModeModalType modalType)
    {
        if (modalType != BuildModeModalType.EXIT)
        {
            return;
        }

        OnLogoutAction?.Invoke();

        controllers.buildModeConfirmationModalController.OnCancelExit  -= CancelExitModal;
        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmExitModal;
    }
Example #3
0
    private void Awake()
    {
        toggleUIVisibilityInputAction.OnTriggered       += OnUIVisiblityToggleActionTriggered;
        toggleControlsVisibilityInputAction.OnTriggered += OnControlsToggleActionTriggered;

        toggleChangeCameraInputAction.OnTriggered   += OnChangeModeActionTriggered;
        toggleTranslateInputAction.OnTriggered      += OnTranslateActionTriggered;
        toggleRotateInputAction.OnTriggered         += OnRotateActionTriggered;
        toggleScaleInputAction.OnTriggered          += OnScaleActionTriggered;
        toggleResetInputAction.OnTriggered          += OnResetActionTriggered;
        toggleDuplicateInputAction.OnTriggered      += OnDuplicateActionTriggered;
        toggleDeleteInputAction.OnTriggered         += OnDeleteActionTriggered;
        toggleOpenEntityListInputAction.OnTriggered += OnEntityListActionTriggered;
        toggleSceneInfoInputAction.OnTriggered      += OnSceneLimitInfoControllerChangeVisibilityTriggered;
        toggleCatalogInputAction.OnTriggered        += OnSceneCatalogControllerChangeVisibilityTriggered;


        entityListBtn.onClick.AddListener(() => OnEntityListChangeVisibilityAction?.Invoke());

        foreach (Button closeEntityListBtn in closeEntityListBtns)
        {
            closeEntityListBtn.onClick.AddListener(() => OnEntityListChangeVisibilityAction?.Invoke());
        }


        catalogBtn.onClick.AddListener(() => OnSceneCatalogControllerChangeVisibilityAction?.Invoke());
        closeCatalogBtn.onClick.AddListener(() => OnSceneCatalogControllerChangeVisibilityAction?.Invoke());


        changeModeBtn.onClick.AddListener(() => OnChangeModeAction?.Invoke());
        firstPersonChangeModeBtn.onClick.AddListener(() => OnChangeModeAction?.Invoke());
        extraBtn.onClick.AddListener(() => OnExtraBtnsClick?.Invoke());
        controlsBtn.onClick.AddListener(() => OnControlsVisibilityAction?.Invoke());
        closeControlsBtn.onClick.AddListener(() => OnControlsVisibilityAction?.Invoke());
        hideUIBtn.onClick.AddListener(() => OnChangeUIVisbilityAction?.Invoke());

        translateBtn.onClick.AddListener(() => OnTranslateSelectionAction?.Invoke());
        rotateBtn.onClick.AddListener(() => OnRotateSelectionAction?.Invoke());
        scaleBtn.onClick.AddListener(() => OnScaleSelectionAction?.Invoke());
        resetBtn.onClick.AddListener(() => OnResetSelectedAction?.Invoke());
        duplicateBtn.onClick.AddListener(() => OnDuplicateSelectionAction?.Invoke());
        deleteBtn.onClick.AddListener(() => OnDeleteSelectionAction?.Invoke());

        sceneObjectCatalogController.OnCatalogItemSelected += (x) => OnCatalogItemSelected?.Invoke(x);
        catalogGroupListView.OnResumeInput += () => OnResumeInput?.Invoke();
        catalogGroupListView.OnStopInput   += () => OnStopInput?.Invoke();

        tutorialBtn.onClick.AddListener(() => OnTutorialAction?.Invoke());
        publishBtn.onClick.AddListener(() => OnPublishAction?.Invoke());
        logOutBtn.onClick.AddListener(() => OnLogoutAction?.Invoke());
    }
Example #4
0
    internal void ConfirmExitModal(BuildModeModalType modalType)
    {
        if (modalType != BuildModeModalType.EXIT)
        {
            return;
        }

        OnLogoutAction?.Invoke();

        controllers.buildModeConfirmationModalController.OnCancelExit  -= CancelExitModal;
        controllers.buildModeConfirmationModalController.OnConfirmExit -= ConfirmExitModal;

        controllers.publicationDetailsController.SetDefaultPublicationInfo();
    }
 private void ConfigureTopActionsButtonsController()
 {
     controllers.topActionsButtonsController.OnChangeModeClick += () => OnChangeModeAction?.Invoke();
     controllers.topActionsButtonsController.OnExtraClick      += ChangeVisibilityOfExtraBtns;
     controllers.topActionsButtonsController.OnTranslateClick  += () => OnTranslateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnRotateClick     += () => OnRotateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnScaleClick      += () => OnScaleSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnResetClick      += () => OnResetAction?.Invoke();
     controllers.topActionsButtonsController.OnDuplicateClick  += () => OnDuplicateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnDeleteClick     += () => OnDeleteSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnLogOutClick     += () => OnLogoutAction?.Invoke();
     controllers.topActionsButtonsController.extraActionsController.OnControlsClick += ChangeVisibilityOfControls;
     controllers.topActionsButtonsController.extraActionsController.OnHideUIClick   += ChangeVisibilityOfUI;
     controllers.topActionsButtonsController.extraActionsController.OnTutorialClick += () => OnTutorialAction?.Invoke();
 }