Skip to content

fix: dotnet format over solution based on project's .editorconfig file #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private void ValidateNodeNames(AnimatorTriggeredSpecialFX fx)
int totalErrors = 0;
for (int i = 0; i < fx.m_EventsOnNodeEntry.Length; ++i)
{
for (int j = i+1; j < fx.m_EventsOnNodeEntry.Length; ++j)
for (int j = i + 1; j < fx.m_EventsOnNodeEntry.Length; ++j)
{
if (fx.m_EventsOnNodeEntry[i].m_AnimatorNodeNameHash == fx.m_EventsOnNodeEntry[j].m_AnimatorNodeNameHash
&& fx.m_EventsOnNodeEntry[i].m_AnimatorNodeNameHash != 0
Expand Down
6 changes: 3 additions & 3 deletions Assets/BossRoom/Scripts/Client/Audio/BossMusicStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ void Start()
void OnDestroy()
{
var netState = GetComponent<NetworkCharacterState>();
if( netState != null )
if (netState != null)
{
netState.NetworkLifeState.LifeState.OnValueChanged -= OnLifeStateChanged;
if( netState.HealthState != null )
if (netState.HealthState != null)
{
netState.HealthState.HitPoints.OnValueChanged -= OnHealthChanged;
}
Expand All @@ -41,7 +41,7 @@ void OnDestroy()

private void OnLifeStateChanged(LifeState previousValue, LifeState newValue)
{
if (newValue!= LifeState.Alive)
if (newValue != LifeState.Alive)
{
// players won! Start victory theme
ClientMusicPlayer.Instance.PlayVictoryMusic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void PlayTrack(AudioClip clip, bool looping, bool restart)
if (m_source.isPlaying)
{
// if we dont want to restart the clip, do nothing if it is playing
if (!restart && m_source.clip==clip) { return; }
if (!restart && m_source.clip == clip) { return; }
m_source.Stop();
}
m_source.clip = clip;
Expand Down
10 changes: 5 additions & 5 deletions Assets/BossRoom/Scripts/Client/Game/Action/ActionFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ public static ActionFX MakeActionFX(ref ActionRequestData data, ClientCharacterV
/// <returns>If true ActionVisualization should pre-emptively create the ActionFX on the owning client, before hearing back from the server.</returns>
public static bool ShouldAnticipate(ActionVisualization parent, ref ActionRequestData data)
{
if( !parent.Parent.CanPerformActions ) { return false; }
if (!parent.Parent.CanPerformActions) { return false; }

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

//for actions with ShouldClose set, we check our range locally. If we are out of range, we shouldn't anticipate, as we will
//need to execute a ChaseAction (synthesized on the server) prior to actually playing the skill.
bool isTargetEligible = true;
if( data.ShouldClose == true )
if (data.ShouldClose == true)
{
ulong targetId = (data.TargetIds != null && data.TargetIds.Length > 0) ? data.TargetIds[0] : 0;
if(NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(targetId, out NetworkObject networkObject ) )
if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(targetId, out NetworkObject networkObject))
{
float rangeSquared = actionDescription.Range * actionDescription.Range;
isTargetEligible = (networkObject.transform.position - parent.Parent.transform.position).sqrMagnitude < rangeSquared;
Expand Down Expand Up @@ -169,8 +169,8 @@ public virtual void AnticipateAction()
{
Anticipated = true;
TimeStarted = UnityEngine.Time.time;
if(!string.IsNullOrEmpty(Description.AnimAnticipation))

if (!string.IsNullOrEmpty(Description.AnimAnticipation))
{
m_Parent.OurAnimator.SetTrigger(Description.AnimAnticipation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void Update()
}

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

var actionFX = anticipatedActionIndex>=0 ? m_PlayingActions[anticipatedActionIndex] : ActionFX.MakeActionFX(ref data, Parent);
var actionFX = anticipatedActionIndex >= 0 ? m_PlayingActions[anticipatedActionIndex] : ActionFX.MakeActionFX(ref data, Parent);
if (actionFX.Start())
{
m_PlayingActions.Add(actionFX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void PlayHitReact()
return;
}

if (m_Target && m_Target.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject != null )
if (m_Target && m_Target.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject != null)
{
var hitReact = !string.IsNullOrEmpty(Description.ReactAnim) ? Description.ReactAnim : k_DefaultHitReact;
clientCharacter.ChildVizObject.OurAnimator.SetTrigger(hitReact);
Expand Down
4 changes: 2 additions & 2 deletions Assets/BossRoom/Scripts/Client/Game/Action/MeleeActionFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override void Cancel()
}
}
}

private void PlayHitReact()
{
if (m_ImpactPlayed) { return; }
Expand Down Expand Up @@ -127,7 +127,7 @@ private void PlayHitReact()
if (targetNetworkObj.NetworkObjectId != m_Parent.NetworkObjectId)
{
string hitAnim = Description.ReactAnim;
if(string.IsNullOrEmpty(hitAnim)) { hitAnim = k_DefaultHitReact; }
if (string.IsNullOrEmpty(hitAnim)) { hitAnim = k_DefaultHitReact; }
var clientChar = targetNetworkObj.GetComponent<Client.ClientCharacter>();
if (clientChar && clientChar.ChildVizObject && clientChar.ChildVizObject.OurAnimator)
{
Expand Down
18 changes: 9 additions & 9 deletions Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,36 @@ public override bool Start()
return true;
}

private void OnTargetChanged(ulong oldTarget, ulong newTarget )
private void OnTargetChanged(ulong oldTarget, ulong newTarget)
{
m_NewTarget = newTarget;
}

private void OnActionInput(ActionRequestData data )
private void OnActionInput(ActionRequestData data)
{
//this method runs on the owning client, and allows us to anticipate our new target for purposes of FX visualization.
if( data.ActionTypeEnum == ActionType.GeneralTarget )
if (data.ActionTypeEnum == ActionType.GeneralTarget)
{
m_NewTarget = data.TargetIds[0];
}
}

public override bool Update()
{
if( m_CurrentTarget != m_NewTarget )
if (m_CurrentTarget != m_NewTarget)
{
m_CurrentTarget = m_NewTarget;

if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(m_CurrentTarget, out NetworkObject targetObject ) )
if (NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(m_CurrentTarget, out NetworkObject targetObject))
{
var targetEntity = targetObject != null ? targetObject.GetComponent<ITargetable>() : null;
if( targetEntity != null )
if (targetEntity != null)
{
ValidateReticule(targetObject);
m_TargetReticule.SetActive(true);

var parentTransform = targetObject.transform;
if( targetObject.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject )
if (targetObject.TryGetComponent(out Client.ClientCharacter clientCharacter) && clientCharacter.ChildVizObject)
{
//for characters, attach the reticule to the child graphics object.
parentTransform = clientCharacter.ChildVizObject.transform;
Expand Down Expand Up @@ -90,7 +90,7 @@ public override bool Update()
/// </summary>
private void ValidateReticule(NetworkObject targetObject)
{
if( m_TargetReticule == null )
if (m_TargetReticule == null)
{
m_TargetReticule = Object.Instantiate(m_Parent.TargetReticulePrefab);
}
Expand All @@ -108,7 +108,7 @@ public override void Cancel()
GameObject.Destroy(m_TargetReticule);

m_ParentState.TargetId.OnValueChanged -= OnTargetChanged;
if( m_ParentState.TryGetComponent(out Client.ClientInputSender inputSender))
if (m_ParentState.TryGetComponent(out Client.ClientInputSender inputSender))
{
inputSender.ActionInputEvent -= OnActionInput;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void FixedUpdate()
if (m_MoveRequest)
{
m_MoveRequest = false;
if ( (Time.time - m_LastSentMove) > k_MoveSendRateSeconds)
if ((Time.time - m_LastSentMove) > k_MoveSendRateSeconds)
{
m_LastSentMove = Time.time;
var ray = m_MainCamera.ScreenPointToRay(Input.mousePosition);
Expand Down Expand Up @@ -229,7 +229,7 @@ private void PerformSkill(ActionType actionType, SkillTriggerStyle triggerStyle,

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

//sanity check that this is indeed a valid target.
if(targetNetObj==null || !ActionUtils.IsValidTarget(targetNetObj.NetworkObjectId))
if (targetNetObj == null || !ActionUtils.IsValidTarget(targetNetObj.NetworkObjectId))
{
return false;
}
Expand Down Expand Up @@ -414,7 +414,7 @@ void Update()
RequestAction(ActionType.Emote4, SkillTriggerStyle.Keyboard);
}

if ( !EventSystem.current.IsPointerOverGameObject() && m_CurrentSkillInput == null)
if (!EventSystem.current.IsPointerOverGameObject() && m_CurrentSkillInput == null)
{
//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,
//to model the button "blocking" mouse clicks from falling through and interacting with the world.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ void RemoveNetworkCharacter()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
[RequireComponent(typeof(NetworkAvatarGuidState))]
public class ClientAvatarGuidHandler : NetworkBehaviour
{
[SerializeField]
[SerializeField]
Animator m_GraphicsAnimator;

[SerializeField]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public class ClientBreakableVisualization : NetworkBehaviour
[SerializeField]
private GameObject m_BrokenPrefab;

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

[SerializeField]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override void OnNetworkSpawn()

public override void OnNetworkDespawn()
{
if( m_NetState != null )
if (m_NetState != null)
{
transform.parent = m_Parent;
m_NetState.HitEnemyEvent -= OnEnemyHit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
/// </summary>
public class ClientBossRoomState : GameStateBehaviour
{
public override GameState ActiveState { get { return GameState.BossRoom; } }
public override GameState ActiveState { get { return GameState.BossRoom; } }


public override void OnNetworkSpawn()
{
if( !IsClient ) { this.enabled = false; }
if (!IsClient) { this.enabled = false; }
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void UpdatePlayerCount()
{
int count = CharSelectData.LobbyPlayers.Count;
var pstr = (count > 1) ? "players" : "player";
m_NumPlayersText.text = "<b>" + count + "</b> " + pstr +" connected";
m_NumPlayersText.text = "<b>" + count + "</b> " + pstr + " connected";
}

/// <summary>
Expand Down Expand Up @@ -290,7 +290,7 @@ private void UpdateSeats()
{
if (playerState.SeatIdx == -1 || playerState.SeatState == CharSelectData.SeatState.Inactive)
continue; // this player isn't seated at all!
if ( curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Inactive
if (curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Inactive
|| (curSeats[playerState.SeatIdx].SeatState == CharSelectData.SeatState.Active && curSeats[playerState.SeatIdx].LastChangeTime < playerState.LastChangeTime))
{
// this is the best candidate to be displayed in this seat (so far)
Expand Down Expand Up @@ -342,7 +342,7 @@ private void ConfigureUIForLobbyMode(LobbyMode mode)
switch (mode)
{
case LobbyMode.ChooseSeat:
if ( m_LastSeatSelected == -1)
if (m_LastSeatSelected == -1)
{
if (m_CurrentCharacterGraphics)
{
Expand Down Expand Up @@ -391,7 +391,7 @@ public void OnPlayerClickedSeat(int seatIdx)
public void OnPlayerClickedReady()
{
// request to lock in or unlock if already locked in
CharSelectData.ChangeSeatServerRpc(NetworkManager.Singleton.LocalClientId, m_LastSeatSelected, !m_HasLocalPlayerLockedIn );
CharSelectData.ChangeSeatServerRpc(NetworkManager.Singleton.LocalClientId, m_LastSeatSelected, !m_HasLocalPlayerLockedIn);
}

GameObject GetCharacterGraphics(Avatar avatar)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ namespace Unity.Multiplayer.Samples.BossRoom.Client
/// </remarks>
public class ClientMainMenuState : GameStateBehaviour
{
public override GameState ActiveState { get { return GameState.MainMenu; } }
public override GameState ActiveState { get { return GameState.MainMenu; } }
}
}
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Client/UI/HeroEmoteBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void OnDestroy()

public void OnButtonClicked(int buttonIndex)
{
if( m_InputSender != null )
if (m_InputSender != null)
{
switch (buttonIndex)
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/BossRoom/Scripts/Client/UI/MainMenuUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void OnConnectFinished(ConnectStatus status)
/// <param name="connecting">pass true if this is being called in response to a connect finishing.</param>
private void ConnectStatusToMessage(ConnectStatus status, bool connecting)
{
switch(status)
switch (status)
{
case ConnectStatus.Undefined:
case ConnectStatus.UserRequestedDisconnect:
Expand All @@ -168,7 +168,7 @@ private void ConnectStatusToMessage(ConnectStatus status, bool connecting)
m_ResponsePopup.SetupNotifierDisplay("Connection Failed", "The Host is full and cannot accept any additional connections", false, true);
break;
case ConnectStatus.Success:
if(connecting) { m_ResponsePopup.SetupNotifierDisplay("Success!", "Joining Now", false, true); }
if (connecting) { m_ResponsePopup.SetupNotifierDisplay("Success!", "Joining Now", false, true); }
break;
case ConnectStatus.LoggedInAgain:
m_ResponsePopup.SetupNotifierDisplay("Connection Failed", "You have logged in elsewhere using the same account", false, true);
Expand Down
4 changes: 2 additions & 2 deletions Assets/BossRoom/Scripts/Client/UI/PopupPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ OnlineMode OnlineMode

private const string k_DefaultConfirmText = "OK";

static readonly char[] k_InputFieldIncludeChars = new[] {'.', '_'};
static readonly char[] k_InputFieldIncludeChars = new[] { '.', '_' };

/// <summary>
/// Setup this panel to be a panel view to have the player enter the game, complete with the ability for the player to
Expand Down Expand Up @@ -320,7 +320,7 @@ private void OnOnlineModeChanged(OnlineMode value)
// If no health check is currently running
if (m_UnityRelayHealthCheck == null || m_UnityRelayHealthCheck.IsCompleted)
{
if (m_UnityRelayHealthCheck is {Result: true})
if (m_UnityRelayHealthCheck is { Result: true })
{
// If it has already been completed successfully, setup display for entering game
SetupEnterGameDisplayForUnityRelay();
Expand Down
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Client/UI/QualityButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void SetQualitySettings()
m_QualityBtnText.text = QualitySettings.names[QualitySettings.GetQualityLevel()];
}
}
}
}
}


2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Editor/BakingMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void HandleEnvLights(bool realtimeLightsEnabled, bool bakedLightsEnabled,
index.GetComponent<Light>().enabled = realtimeLightsEnabled;
}

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

static void HandleLightProbes(bool lightProbesEnabled, string lightProbesStatus)
Expand Down
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Editor/Readme/Readme.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine;

namespace Unity.Multiplayer.Samples.BossRoom.Editor
Expand Down
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Editor/Readme/ReadmeEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
Expand Down
Loading