Example #1
0
        private static void OnPlayModeStateChanged(PlayModeStateChange state)
        {
            switch (state)
            {
            // 플레이모드 진입 시 딕셔너리 비우기
            case PlayModeStateChange.EnteredPlayMode:
                dataForSaveDict.Clear();
                break;

            // 플레이모드 종료 시 SerializedObject들 업데이트
            case PlayModeStateChange.ExitingPlayMode:

                // 이벤트 호출
                OnBeforeExitingPlayMode?.Invoke();

                // 등록된 SO 업데이트
                foreach (var so in dataForSaveDict.Values)
                {
                    so.Update();
                }
                break;

            // 에디터모드 진입 시 변경사항 적용
            case PlayModeStateChange.EnteredEditMode:
                OnEnterEditMode?.Invoke();
                ApplyAll();
                break;
            }
        }
Example #2
0
    public BuilderInWorldInititalHUDController()
    {
        view = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("BuilderInWorldInitialHUD")).GetComponent <BuilderInWorldInititalHUDView>();

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

        view.OnEnterInEditMode += () => OnEnterEditMode?.Invoke();
        view.OnEnterInEditMode += () => CloseBuilderInWorldInitialView();
    }
Example #3
0
    public void EnterEditMode()
    {
        if (!initialLoadingController.isActive)
        {
            return;
        }

        BuilderInWorldNFTController.i.ClearNFTs();

        ParcelSettings.VISUAL_LOADING_ENABLED = false;

        FindSceneToEdit();

        sceneToEdit.SetEditMode(true);
        cursorGO.SetActive(false);
        parcelUnityMiddlePoint = BuilderInWorldUtils.CalculateUnityMiddlePoint(sceneToEdit);

        if (HUDController.i.builderInWorldMainHud != null)
        {
            HUDController.i.builderInWorldMainHud.SetParcelScene(sceneToEdit);
            HUDController.i.builderInWorldMainHud.RefreshCatalogContent();
            HUDController.i.builderInWorldMainHud.RefreshCatalogAssetPack();
        }

        if (HUDController.i.taskbarHud != null)
        {
            HUDController.i.taskbarHud.SetExploreInteractable(false);
            HUDController.i.taskbarHud.SetMoreTutorialInteractable(false);
        }

        CommonScriptableObjects.builderInWorldNotNecessaryUIVisibilityStatus.Set(false);

        DCLCharacterController.OnPositionSet += ExitAfterCharacterTeleport;

        StartBiwControllers();
        Environment.i.world.sceneController.ActivateBuilderInWorldEditScene();

        initialLoadingController.SetPercentage(100f);

        if (IsNewScene())
        {
            SetupNewScene();
            biwFloorHandler.OnAllParcelsFloorLoaded -= OnAllParcelsFloorLoaded;
            biwFloorHandler.OnAllParcelsFloorLoaded += OnAllParcelsFloorLoaded;
        }
        else
        {
            initialLoadingController.Hide(onHideAction: () =>
            {
                inputController.inputTypeMode = InputTypeMode.BUILD_MODE;
                HUDController.i.builderInWorldMainHud?.SetVisibility(true);
                CommonScriptableObjects.allUIHidden.Set(previousAllUIHidden);
            });
        }

        isBuilderInWorldActivated = true;

        foreach (var groundVisual in groundVisualsGO)
        {
            groundVisual.SetActive(false);
        }

        previousSkyBoxMaterial = RenderSettings.skybox;
        RenderSettings.skybox  = skyBoxMaterial;

        OnEnterEditMode?.Invoke();
    }