Skip to content
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

Revolver reload upgrade #348

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion Assets/Prefabs/GunParts/RevolverBody.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -5337,7 +5337,7 @@ MonoBehaviour:
stats: {fileID: 11400000, guid: ee2a4688da7e5cc3d81a023465de8dd5, type: 2}
attachmentSite: {fileID: 1985392096533510068}
RightHandTarget: {fileID: 8663033856010046827}
LeftHandTarget: {fileID: 0}
LeftHandTarget: {fileID: 2820218217649429305}
reloadEfficiencyPercentage: 1
animator: {fileID: 5886082362856684746}
steamParticles: {fileID: 5463634872343731136}
Expand Down Expand Up @@ -5795,3 +5795,8 @@ Transform:
m_CorrespondingSourceObject: {fileID: 2447682344111834594, guid: 09c4b647d3fb8a0409402e37fb63762d, type: 3}
m_PrefabInstance: {fileID: 3913066976853362162}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2820218217649429305 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 1255778791196483275, guid: 09c4b647d3fb8a0409402e37fb63762d, type: 3}
m_PrefabInstance: {fileID: 3913066976853362162}
m_PrefabAsset: {fileID: 0}
4 changes: 3 additions & 1 deletion Assets/Scripts/Gamestate/PlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ public void SetLayer(int playerIndex)
// Set layers for the camera to ignore (the other players' gun layers, and this layer)
// Bitwise negation of this player's model layer and all gun layers that do not belong to this player
// Gun layers are 4 above their respective player layers.
var playerAndGunMask = ((1 << playerLayer) | allGunsMask) & ~(1 << (playerLayer + 4));
var playerMask = 1 << playerLayer;
var gunMask = (1 << (playerLayer + 4)) ^ allGunsMask;
Fueredoriku marked this conversation as resolved.
Show resolved Hide resolved
var playerAndGunMask = playerMask | gunMask;

// Ignore ammo boxes if this player doesn't have the required body
var hasAmmoBoxBody = identity.Body == ammoMaskItem;
Fueredoriku marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Utils/PlayerIK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public class PlayerIK : MonoBehaviour

private void LateUpdate()
{
if (LeftHandIKTarget)
if (LeftHandIKTarget && LeftHandIKTarget.gameObject.activeInHierarchy)
GenericTwoBodyIK.AnimateTransforms(leftArmRoot, leftArmElbow, leftArmHand, leftHandIKPole, LeftHandIKTarget, leftArmRootOffset, leftArmElbowOffset, modelScaleOffset);

if (RightHandIKTarget)
if (RightHandIKTarget && RightHandIKTarget.gameObject.activeInHierarchy)
{
GenericTwoBodyIK.AnimateTransforms(rightArmRoot, rightArmElbow, rightArmHand, rightHandIKPole, RightHandIKTarget, rightArmRootOffset, rightArmElbowOffset, modelScaleOffset);
rightArmHand.rotation = Quaternion.LookRotation(RightHandIKTarget.transform.forward);
Expand Down