Skip to content

Commit

Permalink
update variables name
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat committed Aug 11, 2023
1 parent 47b3153 commit 1d1fc35
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10075,13 +10075,12 @@ MonoBehaviour:
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
Container: {fileID: 4140518851396729342}
handRange: 3
range:
Horizontal: 1.5
Vertical: 2
pickupIcon: {fileID: 0}
pickupIcon: {fileID: 21300000, guid: d1f34343e08a14e48a856e409c355f32, type: 3}
interactionOrigin: {fileID: 1342008326084027676}
handsController: {fileID: 0}
handsController: {fileID: 2150560678942863610}
--- !u!1 &8935913803077858714
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10395,13 +10394,12 @@ MonoBehaviour:
_addedNetworkObject: {fileID: 2930813178971533500}
_networkObjectCache: {fileID: 2930813178971533500}
Container: {fileID: 7144090709710962679}
handRange: 3
range:
Horizontal: 1.5
Vertical: 2
pickupIcon: {fileID: 0}
pickupIcon: {fileID: 21300000, guid: d1f34343e08a14e48a856e409c355f32, type: 3}
interactionOrigin: {fileID: 6653541696833174003}
handsController: {fileID: 0}
handsController: {fileID: 2150560678942863610}
--- !u!1 &9131769810566877388
GameObject:
m_ObjectHideFlags: 0
Expand Down
14 changes: 7 additions & 7 deletions Assets/Scripts/SS3D/Systems/Inventory/Containers/Hand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using SS3D.Systems.Inventory.Items;
using System.Linq;
using SS3D.Interactions.Interfaces;
Expand All @@ -20,11 +20,11 @@ public class Hand : InteractionSource, IInteractionRangeLimit, IInteractionOrigi
/// <summary>
/// Horizontal and vertical max distance to interact with stuff.
/// </summary>
public RangeLimit range = new(1.5f, 2);
[SerializeField] private RangeLimit _range = new(1.5f, 2);

// pickup icon that this hand uses when there's a pickup interaction
// TODO: When AssetData is on, we should update this to not use this
public Sprite pickupIcon;
[SerializeField] private Sprite _pickupIcon;

/// <summary>
/// The item held in this hand, if it exists
Expand All @@ -34,14 +34,14 @@ public class Hand : InteractionSource, IInteractionRangeLimit, IInteractionOrigi
/// <summary>
/// Point from where distances for interaction is computed.
/// </summary>
public Transform interactionOrigin;
[SerializeField] private Transform _interactionOrigin;

/// <summary>
/// the hands script controlling this hand.
/// </summary>
public Hands handsController;
public Hands HandsController;

public Vector3 InteractionOrigin => interactionOrigin.position;
public Vector3 InteractionOrigin => _interactionOrigin.position;

public delegate void HandEventHandler(Hand hand);
public event HandEventHandler OnHandDisabled;
Expand Down Expand Up @@ -83,7 +83,7 @@ public IInteractionSource GetActiveTool()

public RangeLimit GetInteractionRange()
{
return range;
return _range;
}

[Server]
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/SS3D/Systems/Inventory/Containers/Hands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public override void OnStartServer()
base.OnStartServer();
foreach(Hand hand in PlayerHands)
{
hand.handsController = this;
hand.HandsController = this;
hand.OnHandDisabled += HandleHandRemoved;
}
// Set the selected hand to be the first available one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public override bool Start(InteractionEvent interactionEvent, InteractionReferen


try {
string ckey = hand.handsController.Inventory.Body.Mind.player.Ckey;
string ckey = hand.HandsController.Inventory.Body.Mind.player.Ckey;

// and call the event for picking up items for the Game Mode System
new ItemPickedUpEvent(target, ckey).Invoke(this);
Expand Down

0 comments on commit 1d1fc35

Please sign in to comment.