Skip to content

Commit 4ebfbd5

Browse files
author
simplestar
committedMay 2, 2023
ヨーダ記法やめる
1 parent 0e10175 commit 4ebfbd5

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed
 

‎Assets/SimplestarGame/Network/Scripts/Runner/Game/NetworkGame.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void Join(NetworkPlayer player)
2424
int token = new Guid(Runner.GetPlayerConnectionToken(playerRef)).GetHashCode();
2525
var agentList = FindObjectsOfType<PlayerAgent>();
2626
var sceneAgent = agentList.FirstOrDefault(agent => agent.Token == token);
27-
if (null != sceneAgent)
27+
if (sceneAgent != null)
2828
{
2929
sceneAgent.Object.AssignInputAuthority(playerRef);
3030
player.ActiveAgent = sceneAgent;
@@ -48,11 +48,11 @@ public override void Spawned()
4848
{
4949
this.name = "[Network]Game";
5050
SceneContext.Instance.Game = this;
51-
if (null != SceneContext.Instance.PlayerInput)
51+
if (SceneContext.Instance.PlayerInput != null)
5252
{
5353
Runner.AddCallbacks(SceneContext.Instance.PlayerInput);
5454
}
55-
if (null != SceneContext.Instance.hostClientText)
55+
if (SceneContext.Instance.hostClientText != null)
5656
{
5757
SceneContext.Instance.hostClientText.text = HasStateAuthority ? "Host" : "Client";
5858
}
@@ -82,7 +82,7 @@ void SpawnPlayerAgent(NetworkPlayer player, int token)
8282

8383
void DespawnPlayerAgent(NetworkPlayer player)
8484
{
85-
if (null != player.ActiveAgent)
85+
if (player.ActiveAgent != null)
8686
{
8787
Runner.Despawn(player.ActiveAgent.Object);
8888
player.ActiveAgent = null;

‎Assets/SimplestarGame/Network/Scripts/Runner/Player/PlayerAgent.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class PlayerAgent : NetworkBehaviour
1414
[Rpc(sources: RpcSources.InputAuthority, targets: RpcTargets.StateAuthority)]
1515
public void RPC_SendMessage(string message)
1616
{
17-
if (null != this.textMeshPro)
17+
if (this.textMeshPro != null)
1818
{
1919
this.textMeshPro.text = message;
2020
}
@@ -28,7 +28,7 @@ public static void OnChangedMessage(Changed<PlayerAgent> changed)
2828

2929
void ChangeMessage()
3030
{
31-
if (null != this.textMeshPro)
31+
if (this.textMeshPro != null)
3232
{
3333
this.textMeshPro.text = this.Message.Value;
3434
}
@@ -41,7 +41,7 @@ public static void OnChangedColor(Changed<PlayerAgent> changed)
4141

4242
void ChangedColor()
4343
{
44-
if (null != this.textMeshPro)
44+
if (this.textMeshPro != null)
4545
{
4646
this.textMeshPro.color = this.Color;
4747
}
@@ -51,7 +51,7 @@ internal void SetPlayerColor(Color color)
5151
{
5252
this.Color = color;
5353
this.Message = "Hi.";
54-
if (null != this.textMeshPro)
54+
if (this.textMeshPro != null)
5555
{
5656
this.textMeshPro.text = this.Message.Value;
5757
}
@@ -60,15 +60,15 @@ internal void SetPlayerColor(Color color)
6060
public override void Spawned()
6161
{
6262
this.name = "[Network]PlayerAgent";
63-
if (null == this.mainCamera)
63+
if (this.mainCamera == null)
6464
{
6565
this.mainCamera = GameObject.FindGameObjectWithTag("MainCamera").transform;
6666
}
67-
if (null != this.textMeshPro)
67+
if (this.textMeshPro != null)
6868
{
6969
this.textMeshPro.text = this.Message.Value;
7070
}
71-
if (null != SceneContext.Instance.buttonSend)
71+
if (SceneContext.Instance.buttonSend != null)
7272
{
7373
SceneContext.Instance.buttonSend.onPressed += this.OnSend;
7474
}
@@ -80,9 +80,9 @@ void OnSend()
8080
{
8181
return;
8282
}
83-
if (null != SceneContext.Instance.inputField)
83+
if (SceneContext.Instance.inputField != null)
8484
{
85-
if (null != this.textMeshPro)
85+
if (this.textMeshPro != null)
8686
{
8787
this.textMeshPro.text = SceneContext.Instance.inputField.text;
8888
}

‎Assets/SimplestarGame/Network/Scripts/Scene/NetworkConnectionManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ NetworkRunner InstantiateRunner(out INetworkSceneManager sceneManager)
7575
DontDestroyOnLoad(runner);
7676
runner.name = "[Network]Runner";
7777
sceneManager = runner.GetComponents(typeof(MonoBehaviour)).OfType<INetworkSceneManager>().FirstOrDefault();
78-
if (null == sceneManager)
78+
if (sceneManager == null)
7979
{
8080
Debug.Log($"NetworkRunner does not have any component implementing {nameof(INetworkSceneManager)} interface, adding {nameof(NetworkSceneManagerDefault)}.", runner);
8181
sceneManager = runner.gameObject.AddComponent<NetworkSceneManagerDefault>();

‎Assets/SimplestarGame/Network/Scripts/Tools/FPSCounter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class FPSCounter : MonoBehaviour
66
{
77
void Update()
88
{
9-
if (null == SceneContext.Instance.fpsText)
9+
if (SceneContext.Instance.fpsText == null)
1010
{
1111
return;
1212
}

0 commit comments

Comments
 (0)
Please sign in to comment.