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; }
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 Start() { rotationHoldStartDelegate = (action) => { shouldRotate = true; }; rotationHoldFinishedDelegate = (action) => { shouldRotate = false; }; rotationHold.OnStarted += rotationHoldStartDelegate; rotationHold.OnFinished += rotationHoldFinishedDelegate; builderInputWrapper.OnMouseClick += OnMouseClick; }
private void Awake() { BuilderInWorldInputWrapper.OnMouseDrag += MouseDrag; BuilderInWorldInputWrapper.OnMouseDragRaw += MouseDragRaw; BuilderInWorldInputWrapper.OnMouseWheel += MouseWheel; BuilderInWorldInputWrapper.OnMouseDown += OnInputMouseDown; BuilderInWorldInputWrapper.OnMouseUp += OnInputMouseUp; DCLBuilderGizmoManager.OnGizmoTransformObjectStart += OnGizmoTransformObjectStart; DCLBuilderGizmoManager.OnGizmoTransformObjectEnd += OnGizmoTransformObjectEnd; 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; }
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; }
private void SuscribeToInput() { jumpStartedDelegate = (action) => { lastJumpButtonPressedTime = Time.time; jumpButtonPressed = true; }; jumpFinishedDelegate = (action) => jumpButtonPressed = false; jumpAction.OnStarted += jumpStartedDelegate; jumpAction.OnFinished += jumpFinishedDelegate; sprintStartedDelegate = (action) => isSprinting = true; sprintFinishedDelegate = (action) => isSprinting = false; sprintAction.OnStarted += sprintStartedDelegate; sprintAction.OnFinished += sprintFinishedDelegate; }
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; }
public override void Init(BIWContext context) { base.Init(context); maxDistanceToSelectEntitiesValue = context.firstPersonDynamicVariablesAsset.maxDistanceToSelectEntities; snapFactor = context.firstPersonDynamicVariablesAsset.snapFactor; snapRotationDegresFactor = context.firstPersonDynamicVariablesAsset.snapRotationDegresFactor; snapScaleFactor = context.firstPersonDynamicVariablesAsset.snapScaleFactor; snapDistanceToActivateMovement = context.firstPersonDynamicVariablesAsset.snapDistanceToActivateMovement; scaleSpeed = context.firstPersonDynamicVariablesAsset.scaleSpeed; rotationSpeed = context.firstPersonDynamicVariablesAsset.rotationSpeed; distanceFromCameraForNewEntitties = context.firstPersonDynamicVariablesAsset.distanceFromCameraForNewEntitties; rotationHold = context.inputsReferencesAsset.firstPersonRotationHold; rotationHoldStartDelegate = (action) => { shouldRotate = true; }; rotationHoldFinishedDelegate = (action) => { shouldRotate = false; }; rotationHold.OnStarted += rotationHoldStartDelegate; rotationHold.OnFinished += rotationHoldFinishedDelegate; BIWInputWrapper.OnMouseClick += OnMouseClick; }
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; }
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); }