예제 #1
0
    public void SetBuildMode(EditModeState state)
    {
        if (currentActiveMode != null)
        {
            currentActiveMode.Deactivate();
        }
        isAdvancedModeActive = false;

        currentActiveMode = null;
        switch (state)
        {
        case EditModeState.Inactive:
            break;

        case EditModeState.FirstPerson:
            currentActiveMode = firstPersonMode;
            if (HUDController.i.builderInWorldMainHud != null)
            {
                HUDController.i.builderInWorldMainHud.ActivateFirstPersonModeUI();
                HUDController.i.builderInWorldMainHud.SetVisibilityOfCatalog(false);
            }
            if (cursorGO != null)
            {
                cursorGO.SetActive(true);
            }
            break;

        case EditModeState.GodMode:
            if (cursorGO != null)
            {
                cursorGO.SetActive(false);
            }
            currentActiveMode    = editorMode;
            isAdvancedModeActive = true;
            if (HUDController.i.builderInWorldMainHud != null)
            {
                HUDController.i.builderInWorldMainHud.ActivateGodModeUI();
            }

            avatarRenderer?.SetAvatarVisibility(false);
            break;
        }

        currentEditModeState = state;

        if (currentActiveMode != null)
        {
            currentActiveMode.Activate(sceneToEdit);
            currentActiveMode.SetSnapActive(isSnapActive);
            builderInWorldEntityHandler.SetActiveMode(currentActiveMode);
        }
    }
예제 #2
0
    public void SetBuildMode(EditModeState state)
    {
        EditModeState previousState = currentEditModeState;

        if (currentActiveMode != null)
        {
            currentActiveMode.Deactivate();
        }

        currentActiveMode = null;
        switch (state)
        {
        case EditModeState.Inactive:
            break;

        case EditModeState.FirstPerson:
            currentActiveMode = firstPersonMode;

            if (cursorGO != null)
            {
                cursorGO.SetActive(true);
            }
            break;

        case EditModeState.GodMode:
            if (cursorGO != null)
            {
                cursorGO.SetActive(false);
            }
            currentActiveMode = editorMode;
            break;
        }

        currentEditModeState = state;

        if (currentActiveMode != null)
        {
            currentActiveMode.Activate(sceneToEdit);
            currentActiveMode.SetSnapActive(isSnapActive);
            builderInWorldEntityHandler.SetActiveMode(currentActiveMode);
        }

        OnChangedEditModeState?.Invoke(previousState, state);
    }
예제 #3
0
 public void SetActiveMode(BuilderInWorldMode buildMode)
 {
     currentActiveMode = buildMode;
     DeselectEntities();
 }