diff --git a/Assets/Scenes/Menu.unity b/Assets/Scenes/Menu.unity index 18d1182e3..9e9c33ab7 100644 --- a/Assets/Scenes/Menu.unity +++ b/Assets/Scenes/Menu.unity @@ -416,14 +416,18 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 3717336014748129540, guid: 0e2ad36662a02c3488301a5286b27635, type: 3} + propertyPath: startingBody + value: + objectReference: {fileID: 11400000, guid: 0abfdcb5f304f2647b378f82907d538c, type: 2} - target: {fileID: 3717336014748129540, guid: 0e2ad36662a02c3488301a5286b27635, type: 3} propertyPath: startingBarrel value: - objectReference: {fileID: 11400000, guid: 02969ed0b9ffe874eaeaf0b581b01450, type: 2} + objectReference: {fileID: 11400000, guid: 9c1da148c8d07ab428c6bc9a70aecae8, type: 2} - target: {fileID: 3717336014748129540, guid: 0e2ad36662a02c3488301a5286b27635, type: 3} propertyPath: startingExtension value: - objectReference: {fileID: 11400000, guid: 87e98f42380f122a486cd5034ef1d278, type: 2} + objectReference: {fileID: 11400000, guid: 2c332edf0b10a07489ea78f82b8f7045, type: 2} - target: {fileID: 8579357797008554893, guid: 0e2ad36662a02c3488301a5286b27635, type: 3} propertyPath: m_Name value: StaticInfo diff --git a/Assets/Scripts/Augment/AugmentImplementations/RubberSniper.cs b/Assets/Scripts/Augment/AugmentImplementations/RubberSniper.cs index 8c6fb1ebf..e26cec36d 100644 --- a/Assets/Scripts/Augment/AugmentImplementations/RubberSniper.cs +++ b/Assets/Scripts/Augment/AugmentImplementations/RubberSniper.cs @@ -49,6 +49,8 @@ private void Fire(GunStats stats) public void UpdateAimTarget(GunStats stats) { + if (!gunController.Player.inputManager) + return; Vector3 cameraCenter = gunController.Player.inputManager.transform.position; Vector3 cameraDirection = gunController.Player.inputManager.transform.rotation * jigglePhysics.Direction; Vector3 startPoint = cameraCenter + cameraDirection * gunController.Player.TargetStartOffset; @@ -64,7 +66,7 @@ public void UpdateAimTarget(GunStats stats) private void FixedUpdate() { - if (!gunController || !gunController.Player) + if (!gunController || !gunController.Player || !gunController.Player.inputManager) return; var correctedDirection = gunController.Player.inputManager.transform.rotation * jigglePhysics.NormalizedPointer; gunController.Player.HUDController.MoveCrosshair(correctedDirection.x, correctedDirection.y); diff --git a/Assets/Scripts/Augment/FloppyExtensionJiggleMesh.cs b/Assets/Scripts/Augment/FloppyExtensionJiggleMesh.cs index 66b765887..b14fb699c 100644 --- a/Assets/Scripts/Augment/FloppyExtensionJiggleMesh.cs +++ b/Assets/Scripts/Augment/FloppyExtensionJiggleMesh.cs @@ -25,7 +25,7 @@ private void Start() public void AnimatePushback() { - previousDiff += Vector3.up*3; + previousDiff += Vector3.up * 3; } private void UpdatePointer(Vector3 target) @@ -40,7 +40,7 @@ private void Update() var distance = target; jiggleMaterial.SetVector("_Distance", target); var sensitivity = movementSensitivity; - if (player) + if (player && player.inputManager) sensitivity = player.inputManager.moveInput.magnitude < 0.2f ? movementSensitivity : movementSensitivityWalking; previousTarget = target + Quaternion.Inverse(transform.rotation) * -(oldPosition - transform.position) * sensitivity; previousDiff -= distance * jiggleFalloff; diff --git a/Assets/Scripts/Augment/GunController.cs b/Assets/Scripts/Augment/GunController.cs index 3d0b59b8d..b88ce54c0 100644 --- a/Assets/Scripts/Augment/GunController.cs +++ b/Assets/Scripts/Augment/GunController.cs @@ -172,6 +172,10 @@ private void CmdFire(Quaternion rotation) private void RpcFire(Quaternion rotation) { onFireStart?.Invoke(stats); + // TODO does this work? if so, remove output + //if (authority) + //projectile.projectileOutput = outputs[0]; + //projectile.projectileOutput = outputs[0]; projectile.projectileOutput = outputs[0]; projectile.projectileRotation = rotation; ActuallyFire(); diff --git a/Assets/Scripts/Augment/ProjectileController.cs b/Assets/Scripts/Augment/ProjectileController.cs index dd2fb4ec3..8dddece3c 100644 --- a/Assets/Scripts/Augment/ProjectileController.cs +++ b/Assets/Scripts/Augment/ProjectileController.cs @@ -80,6 +80,10 @@ public abstract class ProjectileController : NetworkBehaviour { [HideInInspector] public Transform projectileOutput; + + public Vector3 actualPosition; + public Vector3 actualDirection; + public Quaternion projectileRotation = Quaternion.identity; // Used for muzzle-flashes and other effects, is not where the projectile path actually starts diff --git a/Assets/Scripts/Control&Input/Peer2PeerTransport.cs b/Assets/Scripts/Control&Input/Peer2PeerTransport.cs index 87929e47e..b6071e9f9 100644 --- a/Assets/Scripts/Control&Input/Peer2PeerTransport.cs +++ b/Assets/Scripts/Control&Input/Peer2PeerTransport.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -172,6 +173,25 @@ public override void OnClientConnect() PlayerInstanceByID = new(playerInstances); playerIndex = 0; } + // TODO OnClientDisconnect and the like must be implemented!!! + // - OnServerDisconnect seems to be the one that runs on the server when a client disconnects + + //public override void OnServerDisconnect(NetworkConnectionToClient conn) + //{ + // base.OnServerDisconnect(conn); + // throw new NotImplementedException(); + //} + //public override void OnClientDisconnect() + //{ + // base.OnClientDisconnect(); + // throw new NotImplementedException(); + //} + //// TODO should this be different? + //public override void OnStopClient() + //{ + // base.OnStopClient(); + // throw new NotImplementedException(); + //} public void JoinLobby(string address = "127.0.0.1") {