diff --git a/Assets/jelycho/Code/Player/FPPCamera.cs b/Assets/jelycho/Code/Player/FPPCamera.cs index 95d4639..f521532 100644 --- a/Assets/jelycho/Code/Player/FPPCamera.cs +++ b/Assets/jelycho/Code/Player/FPPCamera.cs @@ -54,8 +54,7 @@ namespace RebootReality.jelycho.Player { } void Awake() { - m_NoiseComponent = - Camera.GetCinemachineComponent(CinemachineCore.Stage.Noise) as CinemachineBasicMultiChannelPerlin; + m_NoiseComponent = Camera.GetCinemachineComponent(CinemachineCore.Stage.Noise) as CinemachineBasicMultiChannelPerlin; Assert.IsNotNull(m_NoiseComponent); SetBobbing(0.0f); diff --git a/Assets/jelycho/Code/Player/PlayerActor.cs b/Assets/jelycho/Code/Player/PlayerActor.cs index 8b34058..78127f9 100755 --- a/Assets/jelycho/Code/Player/PlayerActor.cs +++ b/Assets/jelycho/Code/Player/PlayerActor.cs @@ -433,7 +433,7 @@ namespace RebootReality.jelycho.Player { InterpolateActorState(deltaTime); } - TickCharacterRotation(); + TickCharacterRotation(deltaTime); } protected override void OnActorCommandServer(ulong senderID, ActorCommand actorCommand) { @@ -638,12 +638,13 @@ namespace RebootReality.jelycho.Player { m_CurrentCameraBobbing = Mathf.MoveTowards(m_CurrentCameraBobbing, m_TargetCameraBobbing, m_CameraBobbingTransitionSpeed * deltaTime); - m_Camera.SetBobbing(m_CurrentCameraBobbing); + // m_Camera.SetBobbing(m_CurrentCameraBobbing); + m_Camera.SetBobbing(0.0f); - m_CameraSpring.UpdateSpring(deltaTime, - m_CharacterForwardTransform.up, - m_CharacterForwardTransform.right, - m_CharacterForwardTransform.forward); + // m_CameraSpring.UpdateSpring(deltaTime, + // m_CharacterForwardTransform.up, + // m_CharacterForwardTransform.right, + // m_CharacterForwardTransform.forward); } void SenseInteractable() { @@ -823,7 +824,7 @@ namespace RebootReality.jelycho.Player { // // @MARK: Common // - void TickCharacterRotation() { + void TickCharacterRotation(float dt) { float angleDeg = Mathf.DeltaAngle(m_Camera.Yaw, m_Locomotion.YawRotation); bool rotateCharacter = false; @@ -846,12 +847,13 @@ namespace RebootReality.jelycho.Player { } if (rotateCharacter) { - m_CharacterTurnVelocity = rotateCharacterSpeed * Time.deltaTime; + m_CharacterTurnVelocity = rotateCharacterSpeed * dt; m_CharacterTurnVelocitySmooth = m_CharacterTurnVelocity; - - m_Locomotion.YawRotation = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation, - m_Camera.Yaw, - m_CharacterTurnVelocity); + + float newYaw = Mathf.MoveTowardsAngle(m_Locomotion.YawRotation, + m_Camera.Yaw, + m_CharacterTurnVelocity); + m_Locomotion.YawRotation = newYaw; } // Aim Target adjustment @@ -864,7 +866,7 @@ namespace RebootReality.jelycho.Player { public bool TryGetBeaconPosition(out Vector3 position) { var ray = new Ray(m_Camera.Camera.transform.position, m_Camera.Camera.transform.forward); - + if (Physics.Raycast(ray, out RaycastHit hit, m_BeaconPlacementMaxDistance, m_BeaconPlacementLayerMask) && Vector3.Dot(hit.normal, Vector3.up) >= m_NormalDotUpThreshold) { position = hit.point; diff --git a/Assets/jelycho/Code/Player/PlayerAnimator.cs b/Assets/jelycho/Code/Player/PlayerAnimator.cs index b4e5c96..a948032 100644 --- a/Assets/jelycho/Code/Player/PlayerAnimator.cs +++ b/Assets/jelycho/Code/Player/PlayerAnimator.cs @@ -97,13 +97,13 @@ namespace RebootReality.jelycho.Player { public IPlayable Build(PlayableGraph graph) { m_Mixer = AnimationMixerPlayable.Create(graph, 7); - AnimationClipPlayable idlePlayable = AnimationClipPlayable.Create(graph, m_IdleClip); - AnimationClipPlayable runForwardPlayable = AnimationClipPlayable.Create(graph, m_RunForwardClip); - AnimationClipPlayable runBackwardsPlayable = AnimationClipPlayable.Create(graph, m_RunBackwardsClip); - AnimationClipPlayable strafeRightPlayable = AnimationClipPlayable.Create(graph, m_StrafeRightClip); - AnimationClipPlayable strafeLeftPlayable = AnimationClipPlayable.Create(graph, m_StrafeLeftClip); - AnimationClipPlayable turnRightPlayable = AnimationClipPlayable.Create(graph, m_TurnRightClip); - AnimationClipPlayable turnLeftPlayable = AnimationClipPlayable.Create(graph, m_TurnLeftClip); + var idlePlayable = AnimationClipPlayable.Create(graph, m_IdleClip); + var runForwardPlayable = AnimationClipPlayable.Create(graph, m_RunForwardClip); + var runBackwardsPlayable = AnimationClipPlayable.Create(graph, m_RunBackwardsClip); + var strafeRightPlayable = AnimationClipPlayable.Create(graph, m_StrafeRightClip); + var strafeLeftPlayable = AnimationClipPlayable.Create(graph, m_StrafeLeftClip); + var turnRightPlayable = AnimationClipPlayable.Create(graph, m_TurnRightClip); + var turnLeftPlayable = AnimationClipPlayable.Create(graph, m_TurnLeftClip); m_Mixer.ConnectInput(0, idlePlayable, 0, 1.0f); m_Mixer.ConnectInput(1, runForwardPlayable, 0, 0.0f); @@ -305,12 +305,10 @@ namespace RebootReality.jelycho.Player { m_Hands.OnCharged += () => { onChargeReady?.Invoke(); }; m_QuickKickNode = m_ReAnimator.FindNode("legs_kick_quick"); - + m_IsReady = true; } - void Update() { } - public void SetLocomotionParams(PlayerLocomotionAnimatorParams locomotionParams) { if (!m_IsReady) { return; @@ -318,8 +316,8 @@ namespace RebootReality.jelycho.Player { m_LegsLayerMixer.SetLayerWeight(1, locomotionParams.IsGrounded ? 0.0f : 1.0f); - float2 groundBlendDirection = new float2(locomotionParams.VelocityRightNormalized, - locomotionParams.VelocityForwardNormalized); + var groundBlendDirection = new float2(locomotionParams.VelocityRightNormalized, + locomotionParams.VelocityForwardNormalized); m_GroundBlendTree.SetInput(groundBlendDirection, locomotionParams.TurnVelocity); } diff --git a/Assets/jelycho/RebootReality.jelycho.asmdef b/Assets/jelycho/RebootReality.jelycho.asmdef index 9e409c6..cf8f47c 100644 --- a/Assets/jelycho/RebootReality.jelycho.asmdef +++ b/Assets/jelycho/RebootReality.jelycho.asmdef @@ -19,7 +19,8 @@ "GUID:15fc0a57446b3144c949da3e2b9737a9", "GUID:6fa512e17c315dd428ad692183dd0e8c", "GUID:f2be1b7392ef6cc4eafd0ee8ac7a090a", - "GUID:f0ca7da2c713f5849a8e3326866a5e49" + "GUID:f0ca7da2c713f5849a8e3326866a5e49", + "GUID:7f7d1af65c2641843945d409d28f2e20" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/jelycho/core/player/a_player.prefab b/Assets/jelycho/core/player/a_player.prefab index 3179215..1f06cd4 100644 --- a/Assets/jelycho/core/player/a_player.prefab +++ b/Assets/jelycho/core/player/a_player.prefab @@ -772,6 +772,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 00a9f9c2ce4a41fdaadcfb24c4233127, type: 3} m_Name: m_EditorClassIdentifier: + m_RigBuilder: {fileID: 5341614616933970905} m_ReAnimator: {fileID: 3871962590503854066} m_HandsLayerIndex: 2 onQuickAttackFinished: @@ -817,6 +818,7 @@ MonoBehaviour: mask: {fileID: 0} isAdditive: 0 targetWeight: 0 + tickMode: 0 references: version: 2 RefIds: