Skip to content

Commit 2e2304f

Browse files
fix: dotnet format over solution based on project's .editorconfig file (#465)
1 parent b9be2e0 commit 2e2304f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+136
-130
lines changed

Assets/BossRoom/Scripts/Client/AnimationCallbacks/AnimatorTriggeredSpecialFX.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ private void ValidateNodeNames(AnimatorTriggeredSpecialFX fx)
305305
int totalErrors = 0;
306306
for (int i = 0; i < fx.m_EventsOnNodeEntry.Length; ++i)
307307
{
308-
for (int j = i+1; j < fx.m_EventsOnNodeEntry.Length; ++j)
308+
for (int j = i + 1; j < fx.m_EventsOnNodeEntry.Length; ++j)
309309
{
310310
if (fx.m_EventsOnNodeEntry[i].m_AnimatorNodeNameHash == fx.m_EventsOnNodeEntry[j].m_AnimatorNodeNameHash
311311
&& fx.m_EventsOnNodeEntry[i].m_AnimatorNodeNameHash != 0

Assets/BossRoom/Scripts/Client/Audio/BossMusicStarter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ void Start()
2929
void OnDestroy()
3030
{
3131
var netState = GetComponent<NetworkCharacterState>();
32-
if( netState != null )
32+
if (netState != null)
3333
{
3434
netState.NetworkLifeState.LifeState.OnValueChanged -= OnLifeStateChanged;
35-
if( netState.HealthState != null )
35+
if (netState.HealthState != null)
3636
{
3737
netState.HealthState.HitPoints.OnValueChanged -= OnHealthChanged;
3838
}
@@ -41,7 +41,7 @@ void OnDestroy()
4141

4242
private void OnLifeStateChanged(LifeState previousValue, LifeState newValue)
4343
{
44-
if (newValue!= LifeState.Alive)
44+
if (newValue != LifeState.Alive)
4545
{
4646
// players won! Start victory theme
4747
ClientMusicPlayer.Instance.PlayVictoryMusic();

Assets/BossRoom/Scripts/Client/Audio/ClientMusicPlayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void PlayTrack(AudioClip clip, bool looping, bool restart)
5151
if (m_source.isPlaying)
5252
{
5353
// if we dont want to restart the clip, do nothing if it is playing
54-
if (!restart && m_source.clip==clip) { return; }
54+
if (!restart && m_source.clip == clip) { return; }
5555
m_source.Stop();
5656
}
5757
m_source.clip = clip;

Assets/BossRoom/Scripts/Client/Game/Action/ActionFX.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ public static ActionFX MakeActionFX(ref ActionRequestData data, ClientCharacterV
9595
/// <returns>If true ActionVisualization should pre-emptively create the ActionFX on the owning client, before hearing back from the server.</returns>
9696
public static bool ShouldAnticipate(ActionVisualization parent, ref ActionRequestData data)
9797
{
98-
if( !parent.Parent.CanPerformActions ) { return false; }
98+
if (!parent.Parent.CanPerformActions) { return false; }
9999

100100
var actionDescription = GameDataSource.Instance.ActionDataByType[data.ActionTypeEnum];
101101

102102
//for actions with ShouldClose set, we check our range locally. If we are out of range, we shouldn't anticipate, as we will
103103
//need to execute a ChaseAction (synthesized on the server) prior to actually playing the skill.
104104
bool isTargetEligible = true;
105-
if( data.ShouldClose == true )
105+
if (data.ShouldClose == true)
106106
{
107107
ulong targetId = (data.TargetIds != null && data.TargetIds.Length > 0) ? data.TargetIds[0] : 0;
108-
if(NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(targetId, out NetworkObject networkObject ) )
108+
if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(targetId, out NetworkObject networkObject))
109109
{
110110
float rangeSquared = actionDescription.Range * actionDescription.Range;
111111
isTargetEligible = (networkObject.transform.position - parent.Parent.transform.position).sqrMagnitude < rangeSquared;
@@ -169,8 +169,8 @@ public virtual void AnticipateAction()
169169
{
170170
Anticipated = true;
171171
TimeStarted = UnityEngine.Time.time;
172-
173-
if(!string.IsNullOrEmpty(Description.AnimAnticipation))
172+
173+
if (!string.IsNullOrEmpty(Description.AnimAnticipation))
174174
{
175175
m_Parent.OurAnimator.SetTrigger(Description.AnimAnticipation);
176176
}

Assets/BossRoom/Scripts/Client/Game/Action/ActionVisualization.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void Update()
4444
}
4545

4646
//helper wrapper for a FindIndex call on m_PlayingActions.
47-
private int FindAction(ActionType action, bool anticipatedOnly )
47+
private int FindAction(ActionType action, bool anticipatedOnly)
4848
{
4949
return m_PlayingActions.FindIndex(a => a.Description.ActionTypeEnum == action && (!anticipatedOnly || a.Anticipated));
5050
}
@@ -113,7 +113,7 @@ public void PlayAction(ref ActionRequestData data)
113113
{
114114
var anticipatedActionIndex = FindAction(data.ActionTypeEnum, true);
115115

116-
var actionFX = anticipatedActionIndex>=0 ? m_PlayingActions[anticipatedActionIndex] : ActionFX.MakeActionFX(ref data, Parent);
116+
var actionFX = anticipatedActionIndex >= 0 ? m_PlayingActions[anticipatedActionIndex] : ActionFX.MakeActionFX(ref data, Parent);
117117
if (actionFX.Start())
118118
{
119119
m_PlayingActions.Add(actionFX);

Assets/BossRoom/Scripts/Client/Game/Action/FXProjectileTargetedActionFX.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void PlayHitReact()
8282
return;
8383
}
8484

85-
if (m_Target && m_Target.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject != null )
85+
if (m_Target && m_Target.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject != null)
8686
{
8787
var hitReact = !string.IsNullOrEmpty(Description.ReactAnim) ? Description.ReactAnim : k_DefaultHitReact;
8888
clientCharacter.ChildVizObject.OurAnimator.SetTrigger(hitReact);

Assets/BossRoom/Scripts/Client/Game/Action/MeleeActionFX.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public override void Cancel()
9393
}
9494
}
9595
}
96-
96+
9797
private void PlayHitReact()
9898
{
9999
if (m_ImpactPlayed) { return; }
@@ -127,7 +127,7 @@ private void PlayHitReact()
127127
if (targetNetworkObj.NetworkObjectId != m_Parent.NetworkObjectId)
128128
{
129129
string hitAnim = Description.ReactAnim;
130-
if(string.IsNullOrEmpty(hitAnim)) { hitAnim = k_DefaultHitReact; }
130+
if (string.IsNullOrEmpty(hitAnim)) { hitAnim = k_DefaultHitReact; }
131131
var clientChar = targetNetworkObj.GetComponent<Client.ClientCharacter>();
132132
if (clientChar && clientChar.ChildVizObject && clientChar.ChildVizObject.OurAnimator)
133133
{

Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,36 @@ public override bool Start()
3030
return true;
3131
}
3232

33-
private void OnTargetChanged(ulong oldTarget, ulong newTarget )
33+
private void OnTargetChanged(ulong oldTarget, ulong newTarget)
3434
{
3535
m_NewTarget = newTarget;
3636
}
3737

38-
private void OnActionInput(ActionRequestData data )
38+
private void OnActionInput(ActionRequestData data)
3939
{
4040
//this method runs on the owning client, and allows us to anticipate our new target for purposes of FX visualization.
41-
if( data.ActionTypeEnum == ActionType.GeneralTarget )
41+
if (data.ActionTypeEnum == ActionType.GeneralTarget)
4242
{
4343
m_NewTarget = data.TargetIds[0];
4444
}
4545
}
4646

4747
public override bool Update()
4848
{
49-
if( m_CurrentTarget != m_NewTarget )
49+
if (m_CurrentTarget != m_NewTarget)
5050
{
5151
m_CurrentTarget = m_NewTarget;
5252

53-
if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(m_CurrentTarget, out NetworkObject targetObject ) )
53+
if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(m_CurrentTarget, out NetworkObject targetObject))
5454
{
5555
var targetEntity = targetObject != null ? targetObject.GetComponent<ITargetable>() : null;
56-
if( targetEntity != null )
56+
if (targetEntity != null)
5757
{
5858
ValidateReticule(targetObject);
5959
m_TargetReticule.SetActive(true);
6060

6161
var parentTransform = targetObject.transform;
62-
if( targetObject.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject )
62+
if (targetObject.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject)
6363
{
6464
//for characters, attach the reticule to the child graphics object.
6565
parentTransform = clientCharacter.ChildVizObject.transform;
@@ -90,7 +90,7 @@ public override bool Update()
9090
/// </summary>
9191
private void ValidateReticule(NetworkObject targetObject)
9292
{
93-
if( m_TargetReticule == null )
93+
if (m_TargetReticule == null)
9494
{
9595
m_TargetReticule = Object.Instantiate(m_Parent.TargetReticulePrefab);
9696
}
@@ -108,7 +108,7 @@ public override void Cancel()
108108
GameObject.Destroy(m_TargetReticule);
109109

110110
m_ParentState.TargetId.OnValueChanged -= OnTargetChanged;
111-
if( m_ParentState.TryGetComponent(out Client.ClientInputSender inputSender))
111+
if (m_ParentState.TryGetComponent(out Client.ClientInputSender inputSender))
112112
{
113113
inputSender.ActionInputEvent -= OnActionInput;
114114
}

Assets/BossRoom/Scripts/Client/Game/Character/ClientInputSender.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void FixedUpdate()
165165
if (m_MoveRequest)
166166
{
167167
m_MoveRequest = false;
168-
if ( (Time.time - m_LastSentMove) > k_MoveSendRateSeconds)
168+
if ((Time.time - m_LastSentMove) > k_MoveSendRateSeconds)
169169
{
170170
m_LastSentMove = Time.time;
171171
var ray = m_MainCamera.ScreenPointToRay(Input.mousePosition);
@@ -229,7 +229,7 @@ private void PerformSkill(ActionType actionType, SkillTriggerStyle triggerStyle,
229229

230230
SendInput(playerAction);
231231
}
232-
else if(actionType != ActionType.GeneralTarget )
232+
else if (actionType != ActionType.GeneralTarget)
233233
{
234234
// clicked on nothing... perform an "untargeted" attack on the spot they clicked on.
235235
// (Different Actions will deal with this differently. For some, like archer arrows, this will fire an arrow
@@ -265,7 +265,7 @@ private bool GetActionRequestForTarget(Transform hit, ActionType actionType, Ski
265265
}
266266

267267
//sanity check that this is indeed a valid target.
268-
if(targetNetObj==null || !ActionUtils.IsValidTarget(targetNetObj.NetworkObjectId))
268+
if (targetNetObj == null || !ActionUtils.IsValidTarget(targetNetObj.NetworkObjectId))
269269
{
270270
return false;
271271
}
@@ -414,7 +414,7 @@ void Update()
414414
RequestAction(ActionType.Emote4, SkillTriggerStyle.Keyboard);
415415
}
416416

417-
if ( !EventSystem.current.IsPointerOverGameObject() && m_CurrentSkillInput == null)
417+
if (!EventSystem.current.IsPointerOverGameObject() && m_CurrentSkillInput == null)
418418
{
419419
//IsPointerOverGameObject() is a simple way to determine if the mouse is over a UI element. If it is, we don't perform mouse input logic,
420420
//to model the button "blocking" mouse clicks from falling through and interacting with the world.

Assets/BossRoom/Scripts/Client/Game/Character/ClientPlayerAvatar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ void RemoveNetworkCharacter()
5252
}
5353
}
5454
}
55-
}
55+
}

Assets/BossRoom/Scripts/Client/Game/Entity/ClientAvatarGuidHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
1111
[RequireComponent(typeof(NetworkAvatarGuidState))]
1212
public class ClientAvatarGuidHandler : NetworkBehaviour
1313
{
14-
[SerializeField]
14+
[SerializeField]
1515
Animator m_GraphicsAnimator;
1616

1717
[SerializeField]

Assets/BossRoom/Scripts/Client/Game/Entity/ClientBreakableVisualization.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public class ClientBreakableVisualization : NetworkBehaviour
1212
[SerializeField]
1313
private GameObject m_BrokenPrefab;
1414

15-
[SerializeField][Tooltip("If set, will be used instead of BrokenPrefab when new players join, skipping transition effects.")]
15+
[SerializeField]
16+
[Tooltip("If set, will be used instead of BrokenPrefab when new players join, skipping transition effects.")]
1617
private GameObject m_PrebrokenPrefab;
1718

1819
[SerializeField]

Assets/BossRoom/Scripts/Client/Game/Entity/ClientProjectileVisualization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override void OnNetworkSpawn()
3636

3737
public override void OnNetworkDespawn()
3838
{
39-
if( m_NetState != null )
39+
if (m_NetState != null)
4040
{
4141
transform.parent = m_Parent;
4242
m_NetState.HitEnemyEvent -= OnEnemyHit;

Assets/BossRoom/Scripts/Client/Game/State/ClientBossRoomState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
66
/// </summary>
77
public class ClientBossRoomState : GameStateBehaviour
88
{
9-
public override GameState ActiveState { get { return GameState.BossRoom; } }
9+
public override GameState ActiveState { get { return GameState.BossRoom; } }
1010

1111

1212
public override void OnNetworkSpawn()
1313
{
14-
if( !IsClient ) { this.enabled = false; }
14+
if (!IsClient) { this.enabled = false; }
1515
}
1616

1717
}

Assets/BossRoom/Scripts/Client/Game/State/ClientCharSelectState.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private void UpdatePlayerCount()
167167
{
168168
int count = CharSelectData.LobbyPlayers.Count;
169169
var pstr = (count > 1) ? "players" : "player";
170-
m_NumPlayersText.text = "<b>" + count + "</b> " + pstr +" connected";
170+
m_NumPlayersText.text = "<b>" + count + "</b> " + pstr + " connected";
171171
}
172172

173173
/// <summary>
@@ -290,7 +290,7 @@ private void UpdateSeats()
290290
{
291291
if (playerState.SeatIdx == -1 || playerState.SeatState == CharSelectData.SeatState.Inactive)
292292
continue; // this player isn't seated at all!
293-
if ( curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Inactive
293+
if (curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Inactive
294294
|| (curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Active && curSeats[playerState.SeatIdx].LastChangeTime < playerState.LastChangeTime))
295295
{
296296
// this is the best candidate to be displayed in this seat (so far)
@@ -342,7 +342,7 @@ private void ConfigureUIForLobbyMode(LobbyMode mode)
342342
switch (mode)
343343
{
344344
case LobbyMode.ChooseSeat:
345-
if ( m_LastSeatSelected == -1)
345+
if (m_LastSeatSelected == -1)
346346
{
347347
if (m_CurrentCharacterGraphics)
348348
{
@@ -391,7 +391,7 @@ public void OnPlayerClickedSeat(int seatIdx)
391391
public void OnPlayerClickedReady()
392392
{
393393
// request to lock in or unlock if already locked in
394-
CharSelectData.ChangeSeatServerRpc(NetworkManager.Singleton.LocalClientId, m_LastSeatSelected, !m_HasLocalPlayerLockedIn );
394+
CharSelectData.ChangeSeatServerRpc(NetworkManager.Singleton.LocalClientId, m_LastSeatSelected, !m_HasLocalPlayerLockedIn);
395395
}
396396

397397
GameObject GetCharacterGraphics(Avatar avatar)

Assets/BossRoom/Scripts/Client/Game/State/ClientMainMenuState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
99
/// </remarks>
1010
public class ClientMainMenuState : GameStateBehaviour
1111
{
12-
public override GameState ActiveState { get { return GameState.MainMenu; } }
12+
public override GameState ActiveState { get { return GameState.MainMenu; } }
1313
}
1414
}

Assets/BossRoom/Scripts/Client/UI/HeroEmoteBar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void OnDestroy()
4848

4949
public void OnButtonClicked(int buttonIndex)
5050
{
51-
if( m_InputSender != null )
51+
if (m_InputSender != null)
5252
{
5353
switch (buttonIndex)
5454
{

Assets/BossRoom/Scripts/Client/UI/MainMenuUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private void OnConnectFinished(ConnectStatus status)
159159
/// <param name="connecting">pass true if this is being called in response to a connect finishing.</param>
160160
private void ConnectStatusToMessage(ConnectStatus status, bool connecting)
161161
{
162-
switch(status)
162+
switch (status)
163163
{
164164
case ConnectStatus.Undefined:
165165
case ConnectStatus.UserRequestedDisconnect:
@@ -168,7 +168,7 @@ private void ConnectStatusToMessage(ConnectStatus status, bool connecting)
168168
m_ResponsePopup.SetupNotifierDisplay("Connection Failed", "The Host is full and cannot accept any additional connections", false, true);
169169
break;
170170
case ConnectStatus.Success:
171-
if(connecting) { m_ResponsePopup.SetupNotifierDisplay("Success!", "Joining Now", false, true); }
171+
if (connecting) { m_ResponsePopup.SetupNotifierDisplay("Success!", "Joining Now", false, true); }
172172
break;
173173
case ConnectStatus.LoggedInAgain:
174174
m_ResponsePopup.SetupNotifierDisplay("Connection Failed", "You have logged in elsewhere using the same account", false, true);

Assets/BossRoom/Scripts/Client/UI/PopupPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ OnlineMode OnlineMode
9595

9696
private const string k_DefaultConfirmText = "OK";
9797

98-
static readonly char[] k_InputFieldIncludeChars = new[] {'.', '_'};
98+
static readonly char[] k_InputFieldIncludeChars = new[] { '.', '_' };
9999

100100
/// <summary>
101101
/// Setup this panel to be a panel view to have the player enter the game, complete with the ability for the player to
@@ -320,7 +320,7 @@ private void OnOnlineModeChanged(OnlineMode value)
320320
// If no health check is currently running
321321
if (m_UnityRelayHealthCheck == null || m_UnityRelayHealthCheck.IsCompleted)
322322
{
323-
if (m_UnityRelayHealthCheck is {Result: true})
323+
if (m_UnityRelayHealthCheck is { Result: true })
324324
{
325325
// If it has already been completed successfully, setup display for entering game
326326
SetupEnterGameDisplayForUnityRelay();

Assets/BossRoom/Scripts/Client/UI/QualityButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void SetQualitySettings()
3030
m_QualityBtnText.text = QualitySettings.names[QualitySettings.GetQualityLevel()];
3131
}
3232
}
33-
}
33+
}
3434
}
3535

3636

Assets/BossRoom/Scripts/Editor/BakingMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static void HandleEnvLights(bool realtimeLightsEnabled, bool bakedLightsEnabled,
2525
index.GetComponent<Light>().enabled = realtimeLightsEnabled;
2626
}
2727

28-
Debug.Log( "Environment lights set to " + lightingStatus + ": " + realtimeLights.Length);
28+
Debug.Log("Environment lights set to " + lightingStatus + ": " + realtimeLights.Length);
2929
}
3030

3131
static void HandleLightProbes(bool lightProbesEnabled, string lightProbesStatus)

Assets/BossRoom/Scripts/Editor/Readme/Readme.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using UnityEngine;
33

44
namespace Unity.Multiplayer.Samples.BossRoom.Editor

Assets/BossRoom/Scripts/Editor/Readme/ReadmeEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using UnityEngine;
1+
using UnityEngine;
22
using UnityEditor;
33
using System;
44
using System.IO;

0 commit comments

Comments
 (0)