Skip to content

Commit 0f1b66a

Browse files
author
Ramon Melo
committed
CHANGED: BoltEntity method and property namings
1 parent 21d3ae4 commit 0f1b66a

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

AdvancedTutorial/scripts/Player/PlayerController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void Update()
4545
{
4646
PollKeys(true);
4747

48-
if (entity.isOwner && entity.hasControl && Input.GetKey(KeyCode.L))
48+
if (entity.IsOwner && entity.HasControl && Input.GetKey(KeyCode.L))
4949
{
5050
for (int i = 0; i < 100; ++i)
5151
{
@@ -85,7 +85,7 @@ void PollKeys(bool mouse)
8585

8686
public override void Attached()
8787
{
88-
if (entity.isOwner)
88+
if (entity.IsOwner)
8989
{
9090
state.tokenTest = new TestToken() { Number = 1337 };
9191
}
@@ -146,7 +146,7 @@ public void ApplyDamage(byte damage)
146146

147147
if (state.health == 0)
148148
{
149-
entity.controller.GetPlayer().Kill();
149+
entity.Controller.GetPlayer().Kill();
150150
}
151151
}
152152

@@ -222,7 +222,7 @@ public override void ExecuteCommand(Bolt.Command c, bool resetState)
222222
}
223223
}
224224

225-
if (entity.isOwner)
225+
if (entity.IsOwner)
226226
{
227227
cmd.Result.Token = new TestToken();
228228
}
@@ -267,7 +267,7 @@ void FireWeapon(PlayerCommand cmd)
267267
state.Fire();
268268

269269
// if we are the owner and the active weapon is a hitscan weapon, do logic
270-
if (entity.isOwner)
270+
if (entity.IsOwner)
271271
{
272272
activeWeapon.OnOwner(cmd, entity);
273273
}

AdvancedTutorial/scripts/Player/PlayerNamePlate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ void TeamChanged ()
3030

3131
void Update ()
3232
{
33-
text.GetComponent<Renderer> ().enabled = !entity.hasControl;
33+
text.GetComponent<Renderer> ().enabled = !entity.HasControl;
3434

35-
if (!entity.hasControl) {
35+
if (!entity.HasControl) {
3636
try {
3737
transform.LookAt (PlayerCamera.instance.transform);
3838
transform.rotation = Quaternion.LookRotation (-transform.forward);

AdvancedTutorial/scripts/Weapon/WeaponRifle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class WeaponRifle : WeaponBase
77
{
88
public override void OnOwner (PlayerCommand cmd, BoltEntity entity)
99
{
10-
if (entity.isOwner) {
10+
if (entity.IsOwner) {
1111
IPlayerState state = entity.GetState<IPlayerState> ();
1212
PlayerController controller = entity.GetComponent<PlayerController> ();
1313

GettingStarted/Scripts/CubeBehavior.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public override void Attached()
1616

1717
state.SetTransforms(state.CubeTransform, transform);
1818

19-
if (entity.isOwner)
19+
if (entity.IsOwner)
2020
{
2121
state.CubeColor = new Color(Random.value, Random.value, Random.value);
2222

@@ -39,7 +39,7 @@ public override void Attached()
3939

4040
void OnGUI()
4141
{
42-
if (entity.isOwner)
42+
if (entity.IsOwner)
4343
{
4444
GUI.color = state.CubeColor;
4545
GUILayout.Label("@@@");

GettingStarted/Scripts/InteractiveBehavior.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void Attached()
2323
{
2424
state.SetTransforms(state.Transform, transform);
2525

26-
if (entity.isOwner)
26+
if (entity.IsOwner)
2727
{
2828
state.Color = normalColor;
2929
}
@@ -36,7 +36,7 @@ public override void Attached()
3636

3737
private void Update()
3838
{
39-
if (entity.isAttached && entity.isOwner)
39+
if (entity.IsAttached && entity.IsOwner)
4040
{
4141
var nearbyPlayer = (from player in GameObject.FindGameObjectsWithTag("Player")
4242
where Vector3.Distance(transform.position, player.transform.position) < interactiveRadius

GettingStarted/Scripts/RobotBehavior.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public override void Attached()
1313
{
1414
state.SetTransforms(state.Transform, transform);
1515
state.SetAnimator(GetComponent<Animator>());
16-
state.Animator.applyRootMotion = entity.isOwner;
16+
state.Animator.applyRootMotion = entity.IsOwner;
1717
}
1818

1919
public void AddBox(BoltEntity box)

PhotonCloud/demo_lobby/Scripts/Controllers/BomberPlayerController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public override void Attached()
1212

1313
state.SetTransforms(state.Transform, transform);
1414

15-
if (entity.isOwner)
15+
if (entity.IsOwner)
1616
{
1717
state.Color = Color.white;
1818
}
@@ -60,7 +60,7 @@ private void Setup(string playerName, Color playerColor)
6060
{
6161
BoltConsole.Write("Setup BomberPlayer");
6262

63-
if (entity.isOwner)
63+
if (entity.IsOwner)
6464
{
6565
state.Color = playerColor;
6666
state.Name = playerName;

PhotonCloud/demo_lobby/Scripts/Lobby/LobbyManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public override void EntityAttached(BoltEntity entity)
332332
{
333333
BoltConsole.Write("EntityAttached");
334334

335-
if (!entity.isControlled)
335+
if (!entity.IsControlled)
336336
{
337337
LobbyPhotonPlayer photonPlayer = entity.gameObject.GetComponent<LobbyPhotonPlayer>();
338338

PhotonCloud/demo_lobby/Scripts/Lobby/LobbyPhotonPlayer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public bool IsReady
4242

4343
public override void Attached()
4444
{
45-
if (entity.isOwner)
45+
if (entity.IsOwner)
4646
{
4747
state.Color = Random.ColorHSV();
4848
state.Name = "Player #" + Random.Range(1, 100);
@@ -106,7 +106,7 @@ public override void SimulateController()
106106

107107
public override void ExecuteCommand(Command command, bool resetState)
108108
{
109-
if (!entity.isOwner) { return; }
109+
if (!entity.IsOwner) { return; }
110110

111111
if (!resetState && command.IsFirstExecution)
112112
{
@@ -233,14 +233,14 @@ public void OnClientReady(bool readyState)
233233
}
234234
else
235235
{
236-
ChangeReadyButtonColor(entity.isControlled ? JoinColor : NotReadyColor);
236+
ChangeReadyButtonColor(entity.IsControlled ? JoinColor : NotReadyColor);
237237

238238
Text textComponent = readyButton.transform.GetChild(0).GetComponent<Text>();
239-
textComponent.text = entity.isControlled ? "JOIN" : "...";
239+
textComponent.text = entity.IsControlled ? "JOIN" : "...";
240240
textComponent.color = Color.white;
241-
readyButton.interactable = entity.isControlled;
242-
colorButton.interactable = entity.isControlled;
243-
nameInput.interactable = entity.isControlled;
241+
readyButton.interactable = entity.IsControlled;
242+
colorButton.interactable = entity.IsControlled;
243+
nameInput.interactable = entity.IsControlled;
244244
}
245245
}
246246
}

ThirdPersonCharacter/Scripts/TPCControllerClientAuth.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public override void Attached()
1313

1414
anim = GetComponent<Animator>();
1515

16-
if (!entity.isOwner)
16+
if (!entity.IsOwner)
1717
{
1818
Destroy(GetComponent<ThirdPersonUserControl>());
1919
Destroy(GetComponent<ThirdPersonCharacter>());
@@ -38,7 +38,7 @@ void Update()
3838

3939
void FixedUpdate()
4040
{
41-
if (entity.isOwner)
41+
if (entity.IsOwner)
4242
{
4343
state.grounded = anim.GetBool("OnGround");
4444
state.crouch = anim.GetBool("Crouch");

0 commit comments

Comments
 (0)