Esempio n. 1
0
        void Start()
        {
            mapMetadata = MinimapMetadata.GetMetadata();

            closeButton.onClick.AddListener(() => { ToggleNavMap(); Utils.UnlockCursor(); });
            scrollRect.onValueChanged.AddListener((x) =>
            {
                if (!isOpen) return;

                MapRenderer.i.atlas.UpdateCulling();
                toastView.OnCloseClick();
            });

            toggleNavMapDelegate = (x) => { if (!Input.GetKeyDown(KeyCode.Escape) || isOpen) ToggleNavMap(); };
            toggleNavMapAction.OnTriggered += toggleNavMapDelegate;
            toastView.OnGotoClicked += () => ToggleNavMap(true);

            MapRenderer.OnParcelClicked += TriggerToast;
            MapRenderer.OnParcelHold += TriggerToast;
            MapRenderer.OnParcelHoldCancel += () => { toastView.OnCloseClick(); };

            MinimapHUDView.OnUpdateData += UpdateCurrentSceneData;
            MinimapHUDView.OnOpenNavmapClicked += () => ToggleNavMap();

            toastView.gameObject.SetActive(false);
            scrollRect.gameObject.SetActive(false);
        }
Esempio n. 2
0
        private void Awake()
        {
            closeActionDelegate = (x) => RaiseOnClose();
            closeButton.onClick.AddListener(RaiseOnClose);
            doneButton.onClick.AddListener(RaiseOnDone);

            isOpen = false;
        }
Esempio n. 3
0
    private void Awake()
    {
        closeActionDelegate = (x) => HideMenu();

        buttonToggleMenu.onClick.AddListener(ToggleMenu);
        buttonCopyAddress.onClick.AddListener(CopyAddress);
        copyToast.gameObject.SetActive(false);
    }
Esempio n. 4
0
    private void Start()
    {
        hideSelectedEntitiesDelegate = (action) => ChangeShowStateSelectedEntities();
        showAllEntitiesDelegate      = (action) => ShowAllEntities();

        hideSelectedEntitiesAction.OnTriggered += hideSelectedEntitiesDelegate;
        showAllEntitiesAction.OnTriggered      += showAllEntitiesDelegate;
    }
Esempio n. 5
0
        private void Awake()
        {
            BIWInputWrapper.OnMouseDrag    += MouseDrag;
            BIWInputWrapper.OnMouseDragRaw += MouseDragRaw;
            BIWInputWrapper.OnMouseWheel   += MouseWheel;

            BIWInputWrapper.OnMouseDown += OnInputMouseDown;
            BIWInputWrapper.OnMouseUp   += OnInputMouseUp;

            advanceForwardStartDelegate    = (action) => isAdvancingForward = true;
            advanceForwardFinishedDelegate = (action) => isAdvancingForward = false;

            advanceFowardInputAction.OnStarted  += advanceForwardStartDelegate;
            advanceFowardInputAction.OnFinished += advanceForwardFinishedDelegate;

            advanceBackStartDelegate    = (action) => isAdvancingBackward = true;
            advanceBackFinishedDelegate = (action) => isAdvancingBackward = false;

            advanceBackInputAction.OnStarted  += advanceBackStartDelegate;
            advanceBackInputAction.OnFinished += advanceBackFinishedDelegate;

            advanceLeftStartDelegate    = (action) => isAdvancingLeft = true;
            advanceLeftFinishedDelegate = (action) => isAdvancingLeft = false;

            advanceLeftInputAction.OnStarted  += advanceLeftStartDelegate;
            advanceLeftInputAction.OnFinished += advanceLeftFinishedDelegate;

            advanceRightStartDelegate    = (action) => isAdvancingRight = true;
            advanceRightFinishedDelegate = (action) => isAdvancingRight = false;

            advanceRightInputAction.OnStarted  += advanceRightStartDelegate;
            advanceRightInputAction.OnFinished += advanceRightFinishedDelegate;

            advanceUpStartDelegate    = (action) => isAdvancingUp = true;
            advanceUpFinishedDelegate = (action) => isAdvancingUp = false;

            advanceUpInputAction.OnStarted  += advanceUpStartDelegate;
            advanceUpInputAction.OnFinished += advanceUpFinishedDelegate;

            advanceDownStartDelegate    = (action) => isAdvancingDown = true;
            advanceDownFinishedDelegate = (action) => isAdvancingDown = false;

            advanceDownInputAction.OnStarted  += advanceDownStartDelegate;
            advanceDownInputAction.OnFinished += advanceDownFinishedDelegate;

            cameraPanStartDelegate    = (action) => isPanCameraActive = true;
            cameraPanFinishedDelegate = (action) => isPanCameraActive = false;

            cameraPanInputAction.OnStarted  += cameraPanStartDelegate;
            cameraPanInputAction.OnFinished += cameraPanFinishedDelegate;

            zoomInFromKeyboardDelegate = (action) => MouseWheel(1f);
            zoomInFromKeyboardInputAction.OnTriggered += zoomInFromKeyboardDelegate;

            zoomOutFromKeyboardDelegate = (action) => MouseWheel(-1f);
            zoomOutFromKeyboardInputAction.OnTriggered += zoomOutFromKeyboardDelegate;
        }
Esempio n. 6
0
 void Awake()
 {
     voiceChatStartedDelegate           = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(true);
     voiceChatFinishedDelegate          = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(false);
     voiceChatToggleDelegate            = (action) => DCL.Interface.WebInterface.ToggleVoiceChatRecording();
     voiceChatAction.OnStarted         += voiceChatStartedDelegate;
     voiceChatAction.OnFinished        += voiceChatFinishedDelegate;
     voiceChatToggleAction.OnTriggered += voiceChatToggleDelegate;
 }
    private void Awake()
    {
        closeActionDelegate = (x) => HideMenu();

        buttonToggleMenu.onClick.AddListener(ToggleMenu);
        buttonCopyAddress.onClick.AddListener(CopyAddress);
        buttonEditName.onPointerDown       += () => ActivateProfileNameEditionMode(true);
        buttonEditNamePrefix.onPointerDown += () => ActivateProfileNameEditionMode(true);
        inputName.onValueChanged.AddListener(UpdateCharLimit);
        inputName.onDeselect.AddListener((x) => ActivateProfileNameEditionMode(false));
        copyToast.gameObject.SetActive(false);
    }
        void Awake()
        {
            voiceChatStartedDelegate           = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(true);
            voiceChatFinishedDelegate          = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(false);
            voiceChatToggleDelegate            = (action) => DCL.Interface.WebInterface.ToggleVoiceChatRecording();
            voiceChatAction.OnStarted         += voiceChatStartedDelegate;
            voiceChatAction.OnFinished        += voiceChatFinishedDelegate;
            voiceChatToggleAction.OnTriggered += voiceChatToggleDelegate;

            KernelConfig.i.EnsureConfigInitialized().Then(config => EnableVoiceChat(config.comms.voiceChatEnabled));
            KernelConfig.i.OnChange += OnKernelConfigChanged;
        }
    public override void Init(BIWContext context)
    {
        base.Init(context);
        if (HUDController.i.builderInWorldMainHud != null)
        {
            hudController = HUDController.i.builderInWorldMainHud;
            hudController.OnEntityDelete            += DeleteSingleEntity;
            hudController.OnDuplicateSelectedAction += DuplicateSelectedEntitiesInput;
            hudController.OnDeleteSelectedAction    += DeleteSelectedEntitiesInput;
            hudController.OnEntityClick             += ChangeEntitySelectionFromList;
            hudController.OnEntityLock                     += ChangeEntityLockStatus;
            hudController.OnEntityChangeVisibility         += ChangeEntityVisibilityStatus;
            hudController.OnEntityRename                   += SetEntityName;
            hudController.OnEntitySmartItemComponentUpdate += UpdateSmartItemComponentInKernel;
        }


        BIWInputWrapper.OnMouseDown += OnInputMouseDown;
        BIWInputWrapper.OnMouseUp   += OnInputMouseUp;

        DCL.Environment.i.world.sceneBoundsChecker.OnEntityBoundsCheckerStatusChanged += ChangeEntityBoundsCheckerStatus;

        bridge = context.sceneReferences.builderInWorldBridge;

        outlinerController = context.outlinerController;

        modeController    = context.modeController;
        actionController  = context.actionController;
        creatorController = context.creatorController;
        raycastController = context.raycastController;

        editMaterial = context.projectReferencesAsset.editMaterial;

        hideSelectedEntitiesAction = context.inputsReferencesAsset.hideSelectedEntitiesAction;
        showAllEntitiesAction      = context.inputsReferencesAsset.showAllEntitiesAction;

        hideSelectedEntitiesDelegate = (action) => ChangeShowStateSelectedEntities();
        showAllEntitiesDelegate      = (action) => ShowAllEntities();

        hideSelectedEntitiesAction.OnTriggered += hideSelectedEntitiesDelegate;
        showAllEntitiesAction.OnTriggered      += showAllEntitiesDelegate;

        actionController.OnRedo += ReSelectEntities;
        actionController.OnUndo += ReSelectEntities;
    }
Esempio n. 10
0
    void Start()
    {
        editModeChangeInputAction.OnTriggered += OnEditModeChangeAction;

        redoDelegate = (action) => RedoAction();
        undoDelegate = (action) => UndoAction();

        toggleRedoActionInputAction.OnTriggered += redoDelegate;
        toggleUndoActionInputAction.OnTriggered += undoDelegate;

        multiSelectionStartDelegate    = (action) => StartMultiSelection();
        multiSelectionFinishedDelegate = (action) => EndMultiSelection();

        BuilderInWorldInputWrapper.OnMouseClick += MouseClick;
        biwModeController.OnInputDone           += InputDone;

        multiSelectionInputAction.OnStarted  += multiSelectionStartDelegate;
        multiSelectionInputAction.OnFinished += multiSelectionFinishedDelegate;
    }
Esempio n. 11
0
    private void Awake()
    {
        openExpressionsDelegate = (x) =>
        {
            if (!IsVisible())
            {
                return;
            }
            if (Input.GetKeyDown(KeyCode.Escape) && !IsContentVisible())
            {
                return;
            }
            ToggleContent();
        };
        openExpressionsAction.OnTriggered += openExpressionsDelegate;
        showContentButton.onClick.AddListener(ToggleContent);

        for (int i = 0; i < hideContentButtons.Length; i++)
        {
            hideContentButtons[i].onPointerDown += HideContent;
        }
    }
Esempio n. 12
0
        void Start()
        {
            mapMetadata = MinimapMetadata.GetMetadata();

            closeButton.onClick.AddListener(() =>
            {
                ToggleNavMap();
                Utils.UnlockCursor();
            });
            scrollRect.onValueChanged.AddListener((x) =>
            {
                if (!isOpen)
                {
                    return;
                }

                MapRenderer.i.atlas.UpdateCulling();
                toastView.OnCloseClick();
            });

            toggleNavMapDelegate = (x) =>
            {
                if (!Input.GetKeyDown(KeyCode.Escape) || isOpen)
                {
                    ToggleNavMap();
                }
            };

            toggleNavMapAction.OnTriggered += toggleNavMapDelegate;
            toastView.OnGotoClicked        += () => ToggleNavMap(true);

            MapRenderer.OnParcelClicked    += TriggerToast;
            MapRenderer.OnParcelHold       += TriggerToast;
            MapRenderer.OnParcelHoldCancel += () => { toastView.OnCloseClick(); };
            CommonScriptableObjects.playerCoords.OnChange += UpdateCurrentSceneData;

            Initialize();
        }
    private void Awake()
    {
        waveDelegate = (x) => ExpressionCalled(waveExpression.id);
        waveExpression.inputAction.OnTriggered += waveDelegate;

        robotDelegate = (x) => ExpressionCalled(robotExpression.id);
        robotExpression.inputAction.OnTriggered += robotDelegate;

        fistpumpDelegate = (x) => ExpressionCalled(fistpumpExpression.id);
        fistpumpExpression.inputAction.OnTriggered += fistpumpDelegate;

        raiseHandDelegate = (x) => ExpressionCalled(raiseHandExpression.id);
        raiseHandExpression.inputAction.OnTriggered += raiseHandDelegate;

        clapDelegate = (x) => ExpressionCalled(clapExpression.id);
        clapExpression.inputAction.OnTriggered += clapDelegate;

        throwMoneyDelegate = (x) => ExpressionCalled(throwMoneyExpression.id);
        throwMoneyExpression.inputAction.OnTriggered += throwMoneyDelegate;

        sendKissDelegate = (x) => ExpressionCalled(sendKissExpression.id);
        sendKissExpression.inputAction.OnTriggered += sendKissDelegate;
    }
    public override void Init(BIWContext biwContext)
    {
        base.Init(biwContext);

        actionController   = biwContext.actionController;
        modeController     = biwContext.modeController;
        inputWrapper       = biwContext.inputWrapper;
        outlinerController = biwContext.outlinerController;
        entityHandler      = biwContext.entityHandler;

        toggleRedoActionInputAction = biwContext.inputsReferencesAsset.toggleRedoActionInputAction;
        toggleUndoActionInputAction = biwContext.inputsReferencesAsset.toggleUndoActionInputAction;
        multiSelectionInputAction   = biwContext.inputsReferencesAsset.multiSelectionInputAction;

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnStopInput   += StopInput;
            HUDController.i.builderInWorldMainHud.OnResumeInput += ResumeInput;
        }

        redoDelegate = (action) => RedoAction();
        undoDelegate = (action) => UndoAction();

        toggleRedoActionInputAction.OnTriggered += redoDelegate;
        toggleUndoActionInputAction.OnTriggered += undoDelegate;

        multiSelectionStartDelegate    = (action) => StartMultiSelection();
        multiSelectionFinishedDelegate = (action) => EndMultiSelection();

        BIWInputWrapper.OnMouseClick     += MouseClick;
        BIWInputWrapper.OnMouseClickOnUI += MouseClickOnUI;
        modeController.OnInputDone       += InputDone;

        multiSelectionInputAction.OnStarted  += multiSelectionStartDelegate;
        multiSelectionInputAction.OnFinished += multiSelectionFinishedDelegate;
    }
    public override void Init(BIWContext context)
    {
        base.Init(context);

        cursorGO = context.sceneReferences.cursorCanvas;
        cameraParentGO = context.sceneReferences.cameraParent;
        InitGameObjects();

        firstPersonMode = new BiwFirstPersonMode();
        godMode = new BiwGodMode();

        firstPersonMode.Init(context);
        godMode.Init(context);

        firstPersonMode.OnInputDone += InputDone;
        godMode.OnInputDone += InputDone;

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.OnChangeModeAction += ChangeAdvanceMode;
            HUDController.i.builderInWorldMainHud.OnResetAction += ResetScaleAndRotation;
            HUDController.i.builderInWorldMainHud.OnChangeSnapModeAction += ChangeSnapMode;
        }

        actionController = context.actionController;
        entityHandler = context.entityHandler;
        toggleSnapModeInputAction = context.inputsReferencesAsset.toggleSnapModeInputAction;

        snapModeDelegate = (action) => ChangeSnapMode();
        toggleSnapModeInputAction.OnTriggered += snapModeDelegate;

        firstPersonMode.OnActionGenerated += actionController.AddAction;
        godMode.OnActionGenerated += actionController.AddAction;

        SetEditorGameObjects();
    }
    void Awake()
    {
        sendButton.interactable = false;
        invalidEmailIndicator.SetActive(false);

        closeActionDelegate      = (x) => OnDismiss?.Invoke(dontAskAgain.isOn);
        closeAction.OnTriggered += closeActionDelegate;

        sendButton.onClick.AddListener(() => OnSendEmail?.Invoke(inputField.text));
        closeButton.onClick.AddListener(() => OnDismiss?.Invoke(dontAskAgain.isOn));

        inputField.onValueChanged.AddListener(value =>
        {
            bool isValidValue       = IsValidEmail(value);
            sendButton.interactable = isValidValue;

            if (!string.IsNullOrEmpty(value))
            {
                invalidEmailIndicator.SetActive(!isValidValue);
            }
            else
            {
                invalidEmailIndicator.SetActive(false);
            }
        });

        inputField.onSubmit.AddListener(value =>
        {
            if (sendButton.interactable)
            {
                sendButton.onClick.Invoke();
            }
        });

        showHideAnimator.OnWillFinishStart += OnWillFinishStart;
    }
Esempio n. 17
0
 private void Start()
 {
     createLastSceneObjectDelegate = (action) => CreateLastCatalogItem();
     toggleCreateLastSceneObjectInputAction.OnTriggered += createLastSceneObjectDelegate;
 }
Esempio n. 18
0
 private void Awake()
 {
     closeActionDelegate        = (x) => RaiseOnClose();
     closeButton.onPointerDown += RaiseOnClose;
 }
Esempio n. 19
0
 private void Start()
 {
     snapModeDelegate = (action) => ChangeSnapMode();
     toggleSnapModeInputAction.OnTriggered += snapModeDelegate;
 }
    void Start()
    {
        KernelConfig.i.EnsureConfigInitialized().Then(config => activeFeature = config.features.enableBuilderInWorld);
        KernelConfig.i.OnChange += OnKernelConfigChanged;

        if (snapGO == null)
        {
            snapGO = new GameObject("SnapGameObject");
        }

        snapGO.transform.SetParent(transform);

        if (freeMovementGO == null)
        {
            freeMovementGO = new GameObject("FreeMovementGO");
        }

        freeMovementGO.transform.SetParent(cameraParentGO.transform);

        if (editionGO == null)
        {
            editionGO = new GameObject("EditionGO");
        }

        editionGO.transform.SetParent(cameraParentGO.transform);

        if (undoGO == null)
        {
            undoGO = new GameObject("UndoGameObject");
            undoGO.transform.SetParent(transform);
        }

        HUDConfiguration hudConfig = new HUDConfiguration();

        hudConfig.active  = true;
        hudConfig.visible = false;
        HUDController.i.CreateHudElement <BuildModeHUDController>(hudConfig, HUDController.HUDElementID.BUILDER_IN_WORLD_MAIN);
        HUDController.i.CreateHudElement <BuilderInWorldInititalHUDController>(hudConfig, HUDController.HUDElementID.BUILDER_IN_WORLD_INITIAL);

        editModeChangeInputAction.OnTriggered += OnEditModeChangeAction;

        createLastSceneObjectDelegate = (action) => CreateLastSceneObject();
        redoDelegate     = (action) => RedoAction();
        undoDelegate     = (action) => UndoAction();
        snapModeDelegate = (action) => ChangeSnapMode();

        toggleCreateLastSceneObjectInputAction.OnTriggered += createLastSceneObjectDelegate;
        toggleRedoActionInputAction.OnTriggered            += redoDelegate;
        toggleUndoActionInputAction.OnTriggered            += undoDelegate;
        toggleSnapModeInputAction.OnTriggered += snapModeDelegate;

        multiSelectionStartDelegate    = (action) => StartMultiSelection();
        multiSelectionFinishedDelegate = (action) => EndMultiSelection();

        multiSelectionInputAction.OnStarted  += multiSelectionStartDelegate;
        multiSelectionInputAction.OnFinished += multiSelectionFinishedDelegate;

        HUDController.i.builderInWorldInititalHud.OnEnterEditMode += TryStartEnterEditMode;
        HUDController.i.builderInWorldMainHud.OnStopInput         += StopInput;
        HUDController.i.builderInWorldMainHud.OnResumeInput       += ResumeInput;


        HUDController.i.builderInWorldMainHud.OnChangeModeAction += ChangeAdvanceMode;
        HUDController.i.builderInWorldMainHud.OnResetAction      += ResetScaleAndRotation;

        HUDController.i.builderInWorldMainHud.OnSceneObjectSelected += OnSceneObjectSelected;
        HUDController.i.builderInWorldMainHud.OnTutorialAction      += StartTutorial;
        HUDController.i.builderInWorldMainHud.OnPublishAction       += PublishScene;
        HUDController.i.builderInWorldMainHud.OnLogoutAction        += ExitEditMode;

        BuilderInWorldNFTController.i.OnNFTUsageChange += OnNFTUsageChange;

        builderInputWrapper.OnMouseClick += MouseClick;

        builderInWorldEntityHandler.Init();
        InitEditModes();


        CommonScriptableObjects.builderInWorldNotNecessaryUIVisibilityStatus.Set(true);


        if (!isTestMode)
        {
            ExternalCallsController.i.GetContentAsString(BuilderInWorldSettings.BASE_URL_ASSETS_PACK, CatalogReceived);
            BuilderInWorldNFTController.i.Initialize();
        }

        meshLoadIndicator.SetCamera(Camera.main);
    }
Esempio n. 21
0
 private void Awake()
 {
     closeActionDelegate = (x) => SetVisibility(false);
 }