Skip to content

Commit 94bf326

Browse files
feat: Scene Controller (MAPCO-8869) (#29)
* Create Scene Controller * add simulation scene enum * add simulation scene * remove audio listener * hide preloader view when scene loaded * fade out preloader view * format file * update yahalom componenets * Update application hud * add prefab * edit switch scene * add demo class * add temp ui * revert changes * pr changes * remove name space * pr changes * pr changes * change to enum
1 parent d576e99 commit 94bf326

26 files changed

+2472
-580
lines changed

Assets/Scenes/MainAppScene.unity

Lines changed: 597 additions & 57 deletions
Large diffs are not rendered by default.

Assets/Scenes/PlanningScene.unity

Lines changed: 453 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!29 &1
4+
OcclusionCullingSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 2
7+
m_OcclusionBakeSettings:
8+
smallestOccluder: 5
9+
smallestHole: 0.25
10+
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
13+
--- !u!104 &2
14+
RenderSettings:
15+
m_ObjectHideFlags: 0
16+
serializedVersion: 10
17+
m_Fog: 0
18+
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19+
m_FogMode: 3
20+
m_FogDensity: 0.01
21+
m_LinearFogStart: 0
22+
m_LinearFogEnd: 300
23+
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24+
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25+
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26+
m_AmbientIntensity: 1
27+
m_AmbientMode: 0
28+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29+
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30+
m_HaloStrength: 0.5
31+
m_FlareStrength: 1
32+
m_FlareFadeSpeed: 3
33+
m_HaloTexture: {fileID: 0}
34+
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35+
m_DefaultReflectionMode: 0
36+
m_DefaultReflectionResolution: 128
37+
m_ReflectionBounces: 1
38+
m_ReflectionIntensity: 1
39+
m_CustomReflection: {fileID: 0}
40+
m_Sun: {fileID: 0}
41+
m_UseRadianceAmbientProbe: 0
42+
--- !u!157 &3
43+
LightmapSettings:
44+
m_ObjectHideFlags: 0
45+
serializedVersion: 13
46+
m_BakeOnSceneLoad: 0
47+
m_GISettings:
48+
serializedVersion: 2
49+
m_BounceScale: 1
50+
m_IndirectOutputScale: 1
51+
m_AlbedoBoost: 1
52+
m_EnvironmentLightingMode: 0
53+
m_EnableBakedLightmaps: 1
54+
m_EnableRealtimeLightmaps: 0
55+
m_LightmapEditorSettings:
56+
serializedVersion: 12
57+
m_Resolution: 2
58+
m_BakeResolution: 40
59+
m_AtlasSize: 1024
60+
m_AO: 0
61+
m_AOMaxDistance: 1
62+
m_CompAOExponent: 1
63+
m_CompAOExponentDirect: 0
64+
m_ExtractAmbientOcclusion: 0
65+
m_Padding: 2
66+
m_LightmapParameters: {fileID: 0}
67+
m_LightmapsBakeMode: 1
68+
m_TextureCompression: 1
69+
m_ReflectionCompression: 2
70+
m_MixedBakeMode: 2
71+
m_BakeBackend: 1
72+
m_PVRSampling: 1
73+
m_PVRDirectSampleCount: 32
74+
m_PVRSampleCount: 512
75+
m_PVRBounces: 2
76+
m_PVREnvironmentSampleCount: 256
77+
m_PVREnvironmentReferencePointCount: 2048
78+
m_PVRFilteringMode: 1
79+
m_PVRDenoiserTypeDirect: 1
80+
m_PVRDenoiserTypeIndirect: 1
81+
m_PVRDenoiserTypeAO: 1
82+
m_PVRFilterTypeDirect: 0
83+
m_PVRFilterTypeIndirect: 0
84+
m_PVRFilterTypeAO: 0
85+
m_PVREnvironmentMIS: 1
86+
m_PVRCulling: 1
87+
m_PVRFilteringGaussRadiusDirect: 1
88+
m_PVRFilteringGaussRadiusIndirect: 1
89+
m_PVRFilteringGaussRadiusAO: 1
90+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
91+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
92+
m_PVRFilteringAtrousPositionSigmaAO: 1
93+
m_ExportTrainingData: 0
94+
m_TrainingDataDestination: TrainingData
95+
m_LightProbeSampleCountMultiplier: 4
96+
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
97+
m_LightingSettings: {fileID: 0}
98+
--- !u!196 &4
99+
NavMeshSettings:
100+
serializedVersion: 2
101+
m_ObjectHideFlags: 0
102+
m_BuildSettings:
103+
serializedVersion: 3
104+
agentTypeID: 0
105+
agentRadius: 0.5
106+
agentHeight: 2
107+
agentSlope: 45
108+
agentClimb: 0.4
109+
ledgeDropHeight: 0
110+
maxJumpAcrossDistance: 0
111+
minRegionArea: 2
112+
manualCellSize: 0
113+
cellSize: 0.16666667
114+
manualTileSize: 0
115+
tileSize: 256
116+
buildHeightMesh: 0
117+
maxJobWorkers: 0
118+
preserveTilesOutsideBounds: 0
119+
debug:
120+
m_Flags: 0
121+
m_NavMeshData: {fileID: 0}
122+
--- !u!1 &656381546
123+
GameObject:
124+
m_ObjectHideFlags: 0
125+
m_CorrespondingSourceObject: {fileID: 0}
126+
m_PrefabInstance: {fileID: 0}
127+
m_PrefabAsset: {fileID: 0}
128+
serializedVersion: 6
129+
m_Component:
130+
- component: {fileID: 656381548}
131+
- component: {fileID: 656381547}
132+
m_Layer: 0
133+
m_Name: Directional Light
134+
m_TagString: Untagged
135+
m_Icon: {fileID: 0}
136+
m_NavMeshLayer: 0
137+
m_StaticEditorFlags: 0
138+
m_IsActive: 1
139+
--- !u!108 &656381547
140+
Light:
141+
m_ObjectHideFlags: 0
142+
m_CorrespondingSourceObject: {fileID: 0}
143+
m_PrefabInstance: {fileID: 0}
144+
m_PrefabAsset: {fileID: 0}
145+
m_GameObject: {fileID: 656381546}
146+
m_Enabled: 1
147+
serializedVersion: 11
148+
m_Type: 1
149+
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
150+
m_Intensity: 1
151+
m_Range: 10
152+
m_SpotAngle: 30
153+
m_InnerSpotAngle: 21.80208
154+
m_CookieSize: 10
155+
m_Shadows:
156+
m_Type: 2
157+
m_Resolution: -1
158+
m_CustomResolution: -1
159+
m_Strength: 1
160+
m_Bias: 0.05
161+
m_NormalBias: 0.4
162+
m_NearPlane: 0.2
163+
m_CullingMatrixOverride:
164+
e00: 1
165+
e01: 0
166+
e02: 0
167+
e03: 0
168+
e10: 0
169+
e11: 1
170+
e12: 0
171+
e13: 0
172+
e20: 0
173+
e21: 0
174+
e22: 1
175+
e23: 0
176+
e30: 0
177+
e31: 0
178+
e32: 0
179+
e33: 1
180+
m_UseCullingMatrixOverride: 0
181+
m_Cookie: {fileID: 0}
182+
m_DrawHalo: 0
183+
m_Flare: {fileID: 0}
184+
m_RenderMode: 0
185+
m_CullingMask:
186+
serializedVersion: 2
187+
m_Bits: 4294967295
188+
m_RenderingLayerMask: 1
189+
m_Lightmapping: 4
190+
m_LightShadowCasterMode: 0
191+
m_AreaSize: {x: 1, y: 1}
192+
m_BounceIntensity: 1
193+
m_ColorTemperature: 6570
194+
m_UseColorTemperature: 0
195+
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
196+
m_UseBoundingSphereOverride: 0
197+
m_UseViewFrustumForShadowCasterCull: 1
198+
m_ForceVisible: 0
199+
m_ShadowRadius: 0
200+
m_ShadowAngle: 0
201+
m_LightUnit: 1
202+
m_LuxAtDistance: 1
203+
m_EnableSpotReflector: 1
204+
--- !u!4 &656381548
205+
Transform:
206+
m_ObjectHideFlags: 0
207+
m_CorrespondingSourceObject: {fileID: 0}
208+
m_PrefabInstance: {fileID: 0}
209+
m_PrefabAsset: {fileID: 0}
210+
m_GameObject: {fileID: 656381546}
211+
serializedVersion: 2
212+
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
213+
m_LocalPosition: {x: 0, y: 3, z: 0}
214+
m_LocalScale: {x: 1, y: 1, z: 1}
215+
m_ConstrainProportionsScale: 0
216+
m_Children: []
217+
m_Father: {fileID: 0}
218+
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
219+
--- !u!1 &966296461
220+
GameObject:
221+
m_ObjectHideFlags: 0
222+
m_CorrespondingSourceObject: {fileID: 0}
223+
m_PrefabInstance: {fileID: 0}
224+
m_PrefabAsset: {fileID: 0}
225+
serializedVersion: 6
226+
m_Component:
227+
- component: {fileID: 966296464}
228+
- component: {fileID: 966296463}
229+
- component: {fileID: 966296462}
230+
m_Layer: 0
231+
m_Name: Main Camera
232+
m_TagString: MainCamera
233+
m_Icon: {fileID: 0}
234+
m_NavMeshLayer: 0
235+
m_StaticEditorFlags: 0
236+
m_IsActive: 1
237+
--- !u!81 &966296462
238+
AudioListener:
239+
m_ObjectHideFlags: 0
240+
m_CorrespondingSourceObject: {fileID: 0}
241+
m_PrefabInstance: {fileID: 0}
242+
m_PrefabAsset: {fileID: 0}
243+
m_GameObject: {fileID: 966296461}
244+
m_Enabled: 1
245+
--- !u!20 &966296463
246+
Camera:
247+
m_ObjectHideFlags: 0
248+
m_CorrespondingSourceObject: {fileID: 0}
249+
m_PrefabInstance: {fileID: 0}
250+
m_PrefabAsset: {fileID: 0}
251+
m_GameObject: {fileID: 966296461}
252+
m_Enabled: 1
253+
serializedVersion: 2
254+
m_ClearFlags: 1
255+
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
256+
m_projectionMatrixMode: 1
257+
m_GateFitMode: 2
258+
m_FOVAxisMode: 0
259+
m_Iso: 200
260+
m_ShutterSpeed: 0.005
261+
m_Aperture: 16
262+
m_FocusDistance: 10
263+
m_FocalLength: 50
264+
m_BladeCount: 5
265+
m_Curvature: {x: 2, y: 11}
266+
m_BarrelClipping: 0.25
267+
m_Anamorphism: 0
268+
m_SensorSize: {x: 36, y: 24}
269+
m_LensShift: {x: 0, y: 0}
270+
m_NormalizedViewPortRect:
271+
serializedVersion: 2
272+
x: 0
273+
y: 0
274+
width: 1
275+
height: 1
276+
near clip plane: 0.3
277+
far clip plane: 1000
278+
field of view: 60
279+
orthographic: 0
280+
orthographic size: 5
281+
m_Depth: -1
282+
m_CullingMask:
283+
serializedVersion: 2
284+
m_Bits: 4294967295
285+
m_RenderingPath: -1
286+
m_TargetTexture: {fileID: 0}
287+
m_TargetDisplay: 0
288+
m_TargetEye: 3
289+
m_HDR: 1
290+
m_AllowMSAA: 1
291+
m_AllowDynamicResolution: 0
292+
m_ForceIntoRT: 0
293+
m_OcclusionCulling: 1
294+
m_StereoConvergence: 10
295+
m_StereoSeparation: 0.022
296+
--- !u!4 &966296464
297+
Transform:
298+
m_ObjectHideFlags: 0
299+
m_CorrespondingSourceObject: {fileID: 0}
300+
m_PrefabInstance: {fileID: 0}
301+
m_PrefabAsset: {fileID: 0}
302+
m_GameObject: {fileID: 966296461}
303+
serializedVersion: 2
304+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
305+
m_LocalPosition: {x: 0, y: 1, z: -10}
306+
m_LocalScale: {x: 1, y: 1, z: 1}
307+
m_ConstrainProportionsScale: 0
308+
m_Children: []
309+
m_Father: {fileID: 0}
310+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
311+
--- !u!1660057539 &9223372036854775807
312+
SceneRoots:
313+
m_ObjectHideFlags: 0
314+
m_Roots:
315+
- {fileID: 966296464}
316+
- {fileID: 656381548}

Assets/Scenes/SimulationScene.unity.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UI/UXML/AppHUD.uxml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="MissionButton" style="width: 32px; height: 24px; min-width: 32px; min-height: 24px; max-height: 24px;" />
3434
</ui:VisualElement>
3535
<ui:VisualElement name="HelpButtonContainer" style="flex-grow: 1; width: 48px; height: 48px; min-height: 48px; min-width: 48px; max-width: 48px; max-height: 48px; position: absolute; background-color: rgb(255, 255, 255); right: 16px; bottom: 16px;">
36-
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="HelpButton" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; height: 100%; justify-content: space-around; width: 100%;" />
36+
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="HelpButton" text="?" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; height: 100%; justify-content: space-around; width: 100%; -unity-font-definition: resource(&apos;Fonts/Noto_Sans_Hebrew/NotoSansHebrew-Regular&apos;);" />
3737
</ui:VisualElement>
3838
<ui:VisualElement name="BottomButtonsContainer" style="flex-grow: 1; position: absolute; bottom: 16px; flex-direction: row-reverse; align-self: center; padding-right: 0; margin-top: 0; margin-right: 0; display: flex; visibility: visible; overflow: visible; justify-content: space-between; align-items: stretch; align-content: flex-start; width: 339px; min-width: 339px; max-width: 339px; height: 78px; min-height: 78px; max-height: 78px;">
3939
<ui:VisualElement name="SimulationButtonContainer" style="flex-grow: 1; width: 84px; height: 78px; min-width: 84px; max-width: 84px; min-height: 78px; max-height: 78px;">
40-
<YahalomUIPackage.Runtime.BasicButton.BasicButton style="width: 100%; height: 100%; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%; align-self: center; justify-content: flex-start; align-items: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;" />
40+
<YahalomUIPackage.Runtime.BasicButton.BasicButton text="ןומיא בצמ" style="width: 100%; height: 100%; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%; align-self: center; justify-content: flex-start; align-items: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; -unity-font-definition: resource(&apos;Fonts/Noto_Sans_Hebrew/NotoSansHebrew-Regular&apos;);" />
4141
</ui:VisualElement>
4242
<ui:GroupBox name="ButtonsGroup" style="bottom: auto; height: 78px; min-height: 78px; max-height: 78px; width: 241px; min-width: 241px; max-width: 241px; position: relative; right: auto; background-color: rgb(255, 255, 255); align-self: auto; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; flex-direction: row; justify-content: space-around; align-items: center; align-content: flex-start;">
43-
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="MoreButton" style="width: 60px; height: 42px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-right: 0; margin-top: 0;" />
43+
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="MoreButton" text="דוע" style="width: 60px; height: 42px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-right: 0; margin-top: 0; -unity-font-definition: resource(&apos;Fonts/Noto_Sans_Hebrew/NotoSansHebrew-Regular&apos;);" />
4444
<ui:VisualElement name="Divider" style="width: 1px; height: 42px; background-color: rgb(200, 200, 200); margin-left: 0; margin-right: 0;" />
45-
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="ScreenShotButton" style="height: 42px; width: 60px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-right: 0; margin-top: 0;" />
46-
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="MarkerButton" style="height: 42px; width: 60px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-top: 0; margin-right: 0;" />
45+
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="ScreenShotButton" text="םוליצ" style="height: 42px; width: 60px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-right: 0; margin-top: 0; -unity-font-definition: resource(&apos;Fonts/Noto_Sans_Hebrew/NotoSansHebrew-Regular&apos;);" />
46+
<YahalomUIPackage.Runtime.BasicButton.BasicButton name="MarkerButton" text="ןומיס" style="height: 42px; width: 60px; padding-left: 0; padding-bottom: 0; padding-right: 0; padding-top: 0; margin-left: 0; margin-bottom: 0; margin-top: 0; margin-right: 0; -unity-font-definition: resource(&apos;Fonts/Noto_Sans_Hebrew/NotoSansHebrew-Regular&apos;);" />
4747
</ui:GroupBox>
4848
</ui:VisualElement>
4949
</ui:UXML>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using com.mapcolonies.yahalom.SceneManagement;
2+
using com.mapcolonies.yahalom.SceneManagement.Enums;
3+
using UnityEngine;
4+
using UnityEngine.SceneManagement;
5+
using VContainer;
6+
7+
public class DemoController : MonoBehaviour
8+
{
9+
private ISceneController _sceneController;
10+
11+
[Inject]
12+
public void Construct(ISceneController sceneController)
13+
{
14+
_sceneController = sceneController;
15+
}
16+
17+
public void SwitchScene()
18+
{
19+
Scenes nextScene;
20+
string currentSceneName = SceneManager.GetActiveScene().name;
21+
22+
if (currentSceneName.Equals(Scenes.SimulationScene.ToString()))
23+
{
24+
nextScene = Scenes.PlanningScene;
25+
}
26+
else if (currentSceneName.Equals(Scenes.PlanningScene.ToString()))
27+
{
28+
nextScene = Scenes.SimulationScene;
29+
}
30+
else
31+
{
32+
Debug.LogWarning($"Current scene '{currentSceneName}' is not part of the demo flow.");
33+
return;
34+
}
35+
36+
_ = _sceneController.SwitchSceneAsync(nextScene);
37+
}
38+
}

Assets/com.mapcolonies.yahalom/DemoController.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)