Skip to content

Commit e2ac458

Browse files
committed
Add demo setup controls
1 parent 835d795 commit e2ac458

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

Assets/Scripts/Models/MainReducers.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ public static MainState SetIsAutomationEnabledReducer(MainState state, IAction<b
1313
return state with { IsAutomationEnabled = action.payload };
1414
}
1515

16+
public static MainState SetIsDemoEnabledReducer(MainState state, IAction<bool> action)
17+
{
18+
return state with { IsDemoEnabled = action.payload };
19+
}
20+
1621
public static MainState SetMainSplitViewStateReducer(
1722
MainState state,
1823
IAction<SplitView.State> action
@@ -35,6 +40,9 @@ public static class MainActions
3540
public static readonly ActionCreator<bool> SET_IS_AUTOMATION_ENABLED =
3641
$"{SliceNames.MAIN_SLICE}/SetIsAutomationEnabled";
3742

43+
public static readonly ActionCreator<bool> SET_IS_DEMO_ENABLED =
44+
$"{SliceNames.MAIN_SLICE}/SetIsDemoEnabled";
45+
3846
public static readonly ActionCreator<SplitView.State> SET_MAIN_SPLIT_VIEW_STATE =
3947
$"{SliceNames.MAIN_SLICE}/SetMainSplitViewState";
4048

Assets/Scripts/Models/MainState.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public record MainState
88
{
99
public bool IsAutomationEnabled;
1010

11+
public bool IsDemoEnabled;
12+
1113
public SplitView.State MainSplitViewState;
1214

1315
public int LeftSidePanelTabIndex;

Assets/Scripts/Services/StoreService.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public StoreService(LocalStorageService localStorageService)
6060
MainActions.SET_IS_AUTOMATION_ENABLED,
6161
MainReducers.SetIsAutomationEnabledReducer
6262
)
63+
.AddCase(
64+
MainActions.SET_IS_DEMO_ENABLED,
65+
MainReducers.SetIsDemoEnabledReducer
66+
)
6367
.AddCase(
6468
MainActions.SET_MAIN_SPLIT_VIEW_STATE,
6569
MainReducers.SetMainSplitViewStateReducer
@@ -265,20 +269,33 @@ public StoreService(LocalStorageService localStorageService)
265269
builder =>
266270
{
267271
builder
268-
.AddCase(AtlasSettingsActions.SET_ATLAS_NAME, AtlasSettingsReducers.SetAtlasNameReducer)
272+
.AddCase(
273+
AtlasSettingsActions.SET_ATLAS_NAME,
274+
AtlasSettingsReducers.SetAtlasNameReducer
275+
)
269276
.AddCase(
270277
AtlasSettingsActions.SET_ATLAS_TRANSFORM_NAME,
271278
AtlasSettingsReducers.SetAtlasTransformNameReducer
272279
)
273-
.AddCase(AtlasSettingsActions.SET_REFERENCE_COORD, AtlasSettingsReducers.SetReferenceCoordReducer)
280+
.AddCase(
281+
AtlasSettingsActions.SET_REFERENCE_COORD,
282+
AtlasSettingsReducers.SetReferenceCoordReducer
283+
)
274284
.AddCase(
275285
AtlasSettingsActions.TOGGLE_SHOW_3D_SLICES,
276286
AtlasSettingsReducers.ToggleShow3DSlicesReducer
277287
);
278288
}
279289
);
280290
Store = StoreFactory.CreateStore(
281-
new ISlice<PartitionedState>[] { mainSlice, sceneSlice, settingsSlice, rigSlice, atlasSettingsSlice }
291+
new ISlice<PartitionedState>[]
292+
{
293+
mainSlice,
294+
sceneSlice,
295+
settingsSlice,
296+
rigSlice,
297+
atlasSettingsSlice,
298+
}
282299
);
283300
}
284301

Assets/UI/Views/ManipulatorInspector.uxml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,16 @@
101101
</Bindings>
102102
</Unity.AppUI.UI.Toggle>
103103
</ui:VisualElement>
104+
<ui:VisualElement class="inspector-panel" style="flex-grow: 1;">
105+
<Unity.AppUI.UI.Heading text="Demo" size="S" />
106+
<Unity.AppUI.UI.Heading text="Home" size="XS" />
107+
<Unity.AppUI.UI.Vector4Field />
108+
<Unity.AppUI.UI.Button title="Use Current Position" />
109+
<Unity.AppUI.UI.Heading text="Target" size="XS" />
110+
<Unity.AppUI.UI.Vector4Field />
111+
<Unity.AppUI.UI.Button title="Use Current Position" />
112+
<Unity.AppUI.UI.Spacer />
113+
<Unity.AppUI.UI.Button title="Open Demo Mode" variant="Accent" />
114+
</ui:VisualElement>
104115
</ui:VisualElement>
105116
</ui:UXML>

0 commit comments

Comments
 (0)