Skip to content

Commit db3e9ed

Browse files
committed
Better Cursor Control
1 parent 89b83d1 commit db3e9ed

19 files changed

Lines changed: 1827 additions & 1163 deletions

File tree

Assets/SampleLoader/SampleLoader.cs

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections;
23
using System.Collections.Generic;
34
using UnityEngine;
@@ -6,6 +7,8 @@
67

78
public class SampleLoader : MonoBehaviour
89
{
10+
public static SampleLoader instance;
11+
912
[Header("Loading")]
1013
public Image FullScreenBlack;
1114
public Text SceneNameText;
@@ -43,6 +46,11 @@ public class SampleLoader : MonoBehaviour
4346
bool m_Loading;
4447
float m_FadeTTL;
4548

49+
public event MenuOpenDelegate onMenuToggle;
50+
51+
public delegate void MenuOpenDelegate(bool isOpen);
52+
53+
4654
void Start()
4755
{
4856
if (SceneManager.sceneCountInBuildSettings > 1)
@@ -52,6 +60,8 @@ void Start()
5260
SetMenuVisible(false);
5361
SetLoadSceneWindowVisible(false);
5462
SetDemoMode(true);
63+
64+
instance = this;
5565
}
5666

5767
#region FPS COUNTER
@@ -123,7 +133,13 @@ public void SetMenuVisible(bool visible)
123133
OptionsMenuTransform.anchoredPosition = new Vector3(OptionsMenuTransform.sizeDelta.x, 0, 0);
124134
}
125135

126-
m_MenuVisible = visible;
136+
if(m_MenuVisible != visible)
137+
{
138+
m_MenuVisible = visible;
139+
140+
if(onMenuToggle != null)
141+
onMenuToggle.Invoke(visible);
142+
}
127143
}
128144

129145
public void ExitApplication()
@@ -172,15 +188,22 @@ public void UpdateDemoMode()
172188

173189
#region LOAD SAMPLE WINDOW
174190

175-
bool m_LoadSceneWindowVisible = false;
191+
bool m_LoadSceneWindowVisible = true;
176192

177193
public void SetLoadSceneWindowVisible(bool value)
178194
{
179-
if (value)
180-
SetMenuVisible(false);
195+
if (m_LoadSceneWindowVisible != value)
196+
{
197+
if (value)
198+
SetMenuVisible(false);
199+
200+
LoadSceneWindowRoot.SetActive(value);
181201

182-
LoadSceneWindowRoot.SetActive(value);
183-
m_LoadSceneWindowVisible = value;
202+
m_LoadSceneWindowVisible = value;
203+
204+
if (onMenuToggle != null)
205+
onMenuToggle.Invoke(value);
206+
}
184207
}
185208

186209
public void MenuLoadScene(int index)
@@ -277,6 +300,11 @@ IEnumerator LoadScene(params int[] scene)
277300

278301
}
279302

303+
// Disable menu / load window
304+
SetMenuVisible(false);
305+
SetLoadSceneWindowVisible(false);
306+
307+
280308
SceneNameText.text = "";
281309

282310
AsyncOperation load = SceneManager.LoadSceneAsync(sceneToLoad+1, LoadSceneMode.Additive);

Assets/Samples/ARRadar/ARRadar.unity

Lines changed: 99 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,76 @@ MonoBehaviour:
240240
blendDistance: 0
241241
weight: 1
242242
sharedProfile: {fileID: 11400000, guid: 3f502ec1fcf4bba44914af7490bf650e, type: 2}
243+
--- !u!114 &742739328
244+
MonoBehaviour:
245+
m_ObjectHideFlags: 0
246+
m_CorrespondingSourceObject: {fileID: 0}
247+
m_PrefabInstance: {fileID: 0}
248+
m_PrefabAsset: {fileID: 0}
249+
m_GameObject: {fileID: 0}
250+
m_Enabled: 1
251+
m_EditorHideFlags: 0
252+
m_Script: {fileID: 11500000, guid: a81bcacc415a1f743bfdf703afc52027, type: 3}
253+
m_Name:
254+
m_EditorClassIdentifier:
255+
active: 1
256+
m_AdvancedMode: 0
257+
rotation:
258+
m_OverrideState: 0
259+
m_Value: 0
260+
min: 0
261+
max: 360
262+
skyIntensityMode:
263+
m_OverrideState: 0
264+
m_Value: 0
265+
exposure:
266+
m_OverrideState: 0
267+
m_Value: 0
268+
multiplier:
269+
m_OverrideState: 0
270+
m_Value: 1
271+
min: 0
272+
upperHemisphereLuxValue:
273+
m_OverrideState: 0
274+
m_Value: 1
275+
min: 0
276+
upperHemisphereLuxColor:
277+
m_OverrideState: 0
278+
m_Value: {x: 0, y: 0, z: 0}
279+
desiredLuxValue:
280+
m_OverrideState: 0
281+
m_Value: 20000
282+
updateMode:
283+
m_OverrideState: 0
284+
m_Value: 0
285+
updatePeriod:
286+
m_OverrideState: 0
287+
m_Value: 0
288+
min: 0
289+
includeSunInBaking:
290+
m_OverrideState: 0
291+
m_Value: 0
292+
top:
293+
m_OverrideState: 0
294+
m_Value: {r: 0.06127843, g: 0.072231375, b: 0.101960786, a: 1}
295+
hdr: 1
296+
showAlpha: 0
297+
showEyeDropper: 1
298+
middle:
299+
m_OverrideState: 0
300+
m_Value: {r: 0, g: 0, b: 0, a: 1}
301+
hdr: 1
302+
showAlpha: 0
303+
showEyeDropper: 1
304+
bottom:
305+
m_OverrideState: 0
306+
m_Value: {r: 0.0069999998, g: 0.009394879, b: 0.0139999995, a: 1}
307+
hdr: 1
308+
showAlpha: 0
309+
showEyeDropper: 1
310+
gradientDiffusion:
311+
m_OverrideState: 0
312+
m_Value: 1
243313
--- !u!1 &873957341
244314
GameObject:
245315
m_ObjectHideFlags: 0
@@ -272,7 +342,7 @@ MonoBehaviour:
272342
m_EditorClassIdentifier:
273343
m_Profile: {fileID: 11400000, guid: 2fc0fd5406d3d4d4fba924d77cf7268d, type: 2}
274344
m_StaticLightingSkyUniqueID: 3
275-
m_SkySettings: {fileID: 1280631585}
345+
m_SkySettings: {fileID: 742739328}
276346
m_SkySettingsFromProfile: {fileID: 114411988695810442, guid: 2fc0fd5406d3d4d4fba924d77cf7268d,
277347
type: 2}
278348
--- !u!114 &873957343
@@ -318,13 +388,27 @@ GameObject:
318388
- component: {fileID: 981267660}
319389
- component: {fileID: 981267659}
320390
- component: {fileID: 981267658}
391+
- component: {fileID: 981267657}
321392
m_Layer: 0
322393
m_Name: Main Camera
323394
m_TagString: MainCamera
324395
m_Icon: {fileID: 0}
325396
m_NavMeshLayer: 0
326397
m_StaticEditorFlags: 0
327398
m_IsActive: 1
399+
--- !u!114 &981267657
400+
MonoBehaviour:
401+
m_ObjectHideFlags: 0
402+
m_CorrespondingSourceObject: {fileID: 0}
403+
m_PrefabInstance: {fileID: 0}
404+
m_PrefabAsset: {fileID: 0}
405+
m_GameObject: {fileID: 981267656}
406+
m_Enabled: 1
407+
m_EditorHideFlags: 0
408+
m_Script: {fileID: 11500000, guid: 329a80dfda2a3b947923e71a6a7ed377, type: 3}
409+
m_Name:
410+
m_EditorClassIdentifier:
411+
DefaultCursorVisible: 0
328412
--- !u!114 &981267658
329413
MonoBehaviour:
330414
m_ObjectHideFlags: 0
@@ -817,6 +901,11 @@ MonoBehaviour:
817901
m_UseScreenSpaceShadows: 0
818902
m_InteractsWithSky: 1
819903
m_AngularDiameter: 0
904+
m_FlareSize: 2
905+
m_FlareTint: {r: 1, g: 1, b: 1, a: 1}
906+
m_FlareFalloff: 4
907+
m_SurfaceTexture: {fileID: 0}
908+
m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1}
820909
m_Distance: 150000000
821910
m_UseRayTracedShadows: 0
822911
m_NumRayTracingSamples: 4
@@ -854,6 +943,8 @@ MonoBehaviour:
854943
m_NormalBias: 0.75
855944
m_SlopeBias: 0.5
856945
m_ShadowUpdateMode: 0
946+
m_BarnDoorAngle: 90
947+
m_BarnDoorLength: 0.05
857948
m_ShadowCascadeRatios:
858949
- 0.05
859950
- 0.2
@@ -1031,6 +1122,11 @@ MonoBehaviour:
10311122
m_UseScreenSpaceShadows: 0
10321123
m_InteractsWithSky: 1
10331124
m_AngularDiameter: 0
1125+
m_FlareSize: 2
1126+
m_FlareTint: {r: 1, g: 1, b: 1, a: 1}
1127+
m_FlareFalloff: 4
1128+
m_SurfaceTexture: {fileID: 0}
1129+
m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1}
10341130
m_Distance: 150000000
10351131
m_UseRayTracedShadows: 0
10361132
m_NumRayTracingSamples: 4
@@ -1068,6 +1164,8 @@ MonoBehaviour:
10681164
m_NormalBias: 0.75
10691165
m_SlopeBias: 0.5
10701166
m_ShadowUpdateMode: 0
1167+
m_BarnDoorAngle: 90
1168+
m_BarnDoorLength: 0.05
10711169
m_ShadowCascadeRatios:
10721170
- 0.05
10731171
- 0.2
@@ -1164,70 +1262,3 @@ Animator:
11641262
m_HasTransformHierarchy: 1
11651263
m_AllowConstantClipSamplingOptimization: 1
11661264
m_KeepAnimatorControllerStateOnDisable: 0
1167-
--- !u!114 &1280631585
1168-
MonoBehaviour:
1169-
m_ObjectHideFlags: 0
1170-
m_CorrespondingSourceObject: {fileID: 0}
1171-
m_PrefabInstance: {fileID: 0}
1172-
m_PrefabAsset: {fileID: 0}
1173-
m_GameObject: {fileID: 0}
1174-
m_Enabled: 1
1175-
m_EditorHideFlags: 0
1176-
m_Script: {fileID: 11500000, guid: a81bcacc415a1f743bfdf703afc52027, type: 3}
1177-
m_Name:
1178-
m_EditorClassIdentifier:
1179-
active: 1
1180-
m_AdvancedMode: 0
1181-
rotation:
1182-
m_OverrideState: 0
1183-
m_Value: 0
1184-
min: 0
1185-
max: 360
1186-
skyIntensityMode:
1187-
m_OverrideState: 0
1188-
m_Value: 0
1189-
exposure:
1190-
m_OverrideState: 0
1191-
m_Value: 0
1192-
multiplier:
1193-
m_OverrideState: 0
1194-
m_Value: 1
1195-
min: 0
1196-
upperHemisphereLuxValue:
1197-
m_OverrideState: 0
1198-
m_Value: 1
1199-
min: 0
1200-
desiredLuxValue:
1201-
m_OverrideState: 0
1202-
m_Value: 20000
1203-
updateMode:
1204-
m_OverrideState: 0
1205-
m_Value: 0
1206-
updatePeriod:
1207-
m_OverrideState: 0
1208-
m_Value: 0
1209-
min: 0
1210-
includeSunInBaking:
1211-
m_OverrideState: 0
1212-
m_Value: 0
1213-
top:
1214-
m_OverrideState: 0
1215-
m_Value: {r: 0.06127843, g: 0.072231375, b: 0.101960786, a: 1}
1216-
hdr: 1
1217-
showAlpha: 0
1218-
showEyeDropper: 1
1219-
middle:
1220-
m_OverrideState: 0
1221-
m_Value: {r: 0, g: 0, b: 0, a: 1}
1222-
hdr: 1
1223-
showAlpha: 0
1224-
showEyeDropper: 1
1225-
bottom:
1226-
m_OverrideState: 0
1227-
m_Value: {r: 0.0069999998, g: 0.009394879, b: 0.0139999995, a: 1}
1228-
hdr: 1
1229-
showAlpha: 0
1230-
showEyeDropper: 1
1231-
gradientDiffusion:
1232-
m_OverrideState: 0
1233-
m_Value: 1

0 commit comments

Comments
 (0)