Skip to content

Commit

Permalink
Formatting pass (#11289)
Browse files Browse the repository at this point in the history
* Update .editorconfig

* Formatting
  • Loading branch information
keveleigh authored Dec 13, 2022
1 parent f3f0b28 commit 4d4d269
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ csharp_new_line_between_query_expression_clauses = true
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface IMixedRealityQueryablePointer : IMixedRealityPointer
/// Called to have the pointer query the scene to determine which objects it is hitting. Updates hitinfo.
/// Used when the method for querying the scene utilizes a RaycastHit, such as when using UnityEngine.Physics.Raycast
/// </summary>
bool OnSceneQuery(LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo, out RayStep Ray, out int rayStepIndex );
bool OnSceneQuery(LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo, out RayStep Ray, out int rayStepIndex);

/// <summary>
/// Called to have the pointer query the scene to determine which objects it is hitting. Updates hitObject, hitPoint, and hitDistance.
Expand Down
4 changes: 2 additions & 2 deletions Assets/MRTK/Core/Providers/Hands/BaseHandVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ protected virtual void UpdateHandMesh()

IMixedRealityInputSystem inputSystem = CoreServices.InputSystem;
MixedRealityHandTrackingProfile handTrackingProfile = inputSystem?.InputSystemProfile != null ? inputSystem.InputSystemProfile.HandTrackingProfile : null;
if (newMesh && handTrackingProfile != null)
if (newMesh && handTrackingProfile != null)
{
// Create the hand mesh in the scene and assign the proper material to it
if(handTrackingProfile.SystemHandMeshMaterial.IsNotNull())
if (handTrackingProfile.SystemHandMeshMaterial.IsNotNull())
{
handMeshFilter = new GameObject("System Hand Mesh").EnsureComponent<MeshFilter>();
handMeshFilter.EnsureComponent<MeshRenderer>().material = handTrackingProfile.SystemHandMeshMaterial;
Expand Down
4 changes: 2 additions & 2 deletions Assets/MRTK/Core/Utilities/CoreServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void ResetCacheReferences()
sceneSystem = null;
spatialAwarenessSystem = null;
teleportSystem = null;
}
}

/// <summary>
/// Clears the cache of the reference with key of given type if present and applicable
Expand Down Expand Up @@ -218,7 +218,7 @@ public static T GetDataProvider<T>(IMixedRealityService service) where T : IMixe
// We do not want to keep a service around so use WeakReference
private static readonly Dictionary<Type, WeakReference<IMixedRealityService>> serviceCache = new Dictionary<Type, WeakReference<IMixedRealityService>>();

private static T GetService<T>() where T : IMixedRealityService
private static T GetService<T>() where T : IMixedRealityService
{
Type serviceType = typeof(T);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Utilities;
using Microsoft.MixedReality.Toolkit.XRSDK.Input;
using System.Threading.Tasks;
using Unity.Profiling;
using UnityEngine;
using UnityEngine.XR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public GameObject OVRCameraRigPrefab
set { ovrCameraRigPrefab = value; }
}


[SerializeField]
[FormerlySerializedAs("renderAvatarHandsInsteadOfControllers")]
[Tooltip("Using avatar hands requires a local avatar prefab. Failure to provide one will result in nothing being displayed. \n\n" +
Expand Down Expand Up @@ -170,7 +169,6 @@ public float LowConfidenceTimeThreshold
get => lowConfidenceTimeThreshold;
set => lowConfidenceTimeThreshold = value;
}


#if OCULUSINTEGRATION_PRESENT
[Header("Super sampling")]
Expand Down Expand Up @@ -201,6 +199,4 @@ public void ApplyConfiguredPerformanceSettings()
#endif
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Utilities;
using Microsoft.MixedReality.Toolkit.XRSDK.Input;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.XRSDK.OpenXR
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override void Enable()
EnableIfLoaderBecomesActive();
return;
}

if (!IsActiveLoader.Value)
{
IsEnabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override void OnInspectorGUI()
outlineMaterial.objectReferenceValue = CreateNewMaterial();
}
}
else if(!IsCorrectMaterial(currentMat))
else if (!IsCorrectMaterial(currentMat))
{
EditorGUILayout.HelpBox($"Material may not be configured correctly, check or reset to default", MessageType.Info);

Expand Down Expand Up @@ -97,7 +97,7 @@ private void ForceUpdateToDefaultOutlineMaterial(ref Material material)
break;
case nameof(System.Boolean):
var val = (bool)pair.Value;
if (val)
if (val)
{
material.EnableKeyword(pair.Key);
}
Expand All @@ -119,7 +119,7 @@ private bool IsCorrectMaterial(Material material)
return false;
}

return defaultOutlineMaterialSettings.All(x =>
return defaultOutlineMaterialSettings.All(x =>
{
switch (x.Value.GetType().Name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ private bool IsInputFromNearInteraction(InputEventData eventData)
for (int i = 0; i < focusingPointers.Count; i++)
{
if (focusingPointers[i].InputSourceParent != null &&
focusingPointers[i].InputSourceParent.SourceId == eventData.InputSource.SourceId &&
focusingPointers[i].InputSourceParent.SourceId == eventData.InputSource.SourceId &&
focusingPointers[i] is IMixedRealityNearPointer)
{
isAnyNearpointerFocusing = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Input
Expand Down
8 changes: 4 additions & 4 deletions Assets/MRTK/SDK/Features/UX/Scripts/Pointers/GGVPointer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ public bool OnSceneQuery(LayerMask[] prioritizedLayerMasks, bool focusIndividual
}
else
{
var raycastProvider = CoreServices.InputSystem.RaycastProvider;
bool didHit = raycastProvider.Raycast(Rays[0], prioritizedLayerMasks, focusIndividualCompoundCollider, out hitInfo);
var raycastProvider = CoreServices.InputSystem.RaycastProvider;
bool didHit = raycastProvider.Raycast(Rays[0], prioritizedLayerMasks, focusIndividualCompoundCollider, out hitInfo);
Ray = Rays[0];
rayStepIndex = 0;
return didHit;
Expand All @@ -212,8 +212,8 @@ public bool OnSceneQuery(LayerMask[] prioritizedLayerMasks, bool focusIndividual
}
else
{
var raycastProvider = CoreServices.InputSystem.RaycastProvider;
bool didHit = raycastProvider.Raycast(Rays[0], prioritizedLayerMasks, focusIndividualCompoundCollider, out MixedRealityRaycastHit physicsHit);
var raycastProvider = CoreServices.InputSystem.RaycastProvider;
bool didHit = raycastProvider.Raycast(Rays[0], prioritizedLayerMasks, focusIndividualCompoundCollider, out MixedRealityRaycastHit physicsHit);
if (didHit)
{
hitObject = physicsHit.collider.gameObject;
Expand Down
4 changes: 2 additions & 2 deletions Assets/MRTK/SDK/Features/UX/Scripts/Pointers/PokePointer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ private bool FindClosestTouchableForLayerMask(LayerMask layerMask, out BaseNearI
{
continue;
}
float distance = touchable.DistanceToTouchable(Position, out Vector3 normal);
float distance = touchable.DistanceToTouchable(Position, out Vector3 normal);

// Favor touched volumes, but when there are multiple touched volumes, favor the one with the closest surface.
bool bothInside = (distance <= 0f) && (closestDistance <= 0f);
bool betterFit = bothInside ? Mathf.Abs(distance) < Mathf.Abs(closestDistance) : distance < closestDistance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public override void OnPostSceneQuery()
foreach (var lr in LineRenderers)
{
var lineRenderer = lr as MixedRealityLineRenderer;

if (lineRenderer != null)
{
lineRenderer.LineMaterial = currentMaterial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void OnEnable()
// Begin the follow coroutine when enabled.
AutoFollowAtDistance = autoFollowAtDistance;
}

private void OnDisable()
{
autoFollowDistanceCheck = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Microsoft.MixedReality.Toolkit;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Utilities
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void MigrationKeepObjectAndComponentActiveState()

// Active state of game object and component is kept
Assert.IsFalse(sceneGameObject.activeSelf, $"Active state of migrated game object was not kept during migration with type {migrationHandlerType.Name}");
Assert.IsFalse(((MonoBehaviour)sceneGameObject.GetComponent(newType)).enabled, $"Active state of migrated component was not kept during migration with type { migrationHandlerType.Name}");
Assert.IsFalse(((MonoBehaviour)sceneGameObject.GetComponent(newType)).enabled, $"Active state of migrated component was not kept during migration with type {migrationHandlerType.Name}");

Object.DestroyImmediate(sceneGameObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public IEnumerator NearInteractionTouchableVolumeRaycast()
{
var touchable = CreateTouchable<NearInteractionTouchableVolume>(Vector3.one);
var blocking = CreateTouchable<NearInteractionTouchableVolume>(new Vector3(10f, 10f, 1f));
blocking.transform.localPosition = objectPosition - new Vector3(touchable.TouchableCollider.bounds.extents.z + blocking.TouchableCollider.bounds.extents.z, 0f, 0f);
blocking.transform.localPosition = objectPosition - new Vector3(touchable.TouchableCollider.bounds.extents.z + blocking.TouchableCollider.bounds.extents.z, 0f, 0f);

yield return new WaitForFixedUpdate();
yield return null;
Expand Down

0 comments on commit 4d4d269

Please sign in to comment.