fixed animations

This commit is contained in:
2022-04-13 23:40:33 +07:00
parent 1d41490f11
commit 60e8cc14fd
4 changed files with 16 additions and 4 deletions

View File

@ -1 +1 @@
{"count":1,"self":19.0202384,"total":19.0566016,"children":{"InitializeActuators":{"count":1,"self":0,"total":0,"children":null},"AgentSendState":{"count":716,"self":0.0039968,"total":0.0039968,"children":null},"DecideAction":{"count":716,"self":0.0313674,"total":0.0313674,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649863963","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 08b23f90-bb2b-11ec-8f91-71b1a8087934 -accessToken wPoaGUoqAdMDDj6g73Y4y-aTBFUY2UVeaU34xyILphA009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1649863982"}} {"count":1,"self":30.4209088,"total":30.476561099999998,"children":{"InitializeActuators":{"count":1,"self":0.0009994,"total":0.0009994,"children":null},"AgentSendState":{"count":1272,"self":0.0023281,"total":0.0023281,"children":null},"DecideAction":{"count":1272,"self":0.0513236,"total":0.0513236,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649867954","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 08b23f90-bb2b-11ec-8f91-71b1a8087934 -accessToken wPoaGUoqAdMDDj6g73Y4y-aTBFUY2UVeaU34xyILphA009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1649867984"}}

View File

@ -504,7 +504,7 @@ PrefabInstance:
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, - target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0.09800026 value: 0.098
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, - target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
type: 3} type: 3}
@ -514,7 +514,7 @@ PrefabInstance:
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, - target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
type: 3} type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.4849999 value: 0.81
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, - target: {fileID: -4216859302048453862, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8,
type: 3} type: 3}

View File

@ -49,7 +49,8 @@ public class scr_CharacterController : MonoBehaviour
private float cameraHeight; private float cameraHeight;
private float cameraHeightVelocity; private float cameraHeightVelocity;
private bool isSprinting; [HideInInspector]
public bool isSprinting;
private Vector3 newMovementSpeed; private Vector3 newMovementSpeed;
private Vector3 newMovementSpeedVelocity; private Vector3 newMovementSpeedVelocity;

View File

@ -42,6 +42,12 @@ public class scr_WeaponController : MonoBehaviour
return; return;
} }
CalculateWeaponRotation();
SetWeaponAnimation();
}
private void CalculateWeaponRotation()
{
weaponAnimator.speed = characterController.weaponAnimationSpeed; weaponAnimator.speed = characterController.weaponAnimationSpeed;
targetWeaponRotation.y += settings.SwayAmount * (settings.SwayXInverted ? -characterController.input_View.x : characterController.input_View.x) * Time.deltaTime; targetWeaponRotation.y += settings.SwayAmount * (settings.SwayXInverted ? -characterController.input_View.x : characterController.input_View.x) * Time.deltaTime;
@ -65,4 +71,9 @@ public class scr_WeaponController : MonoBehaviour
transform.localRotation = Quaternion.Euler(newWeaponRotation); transform.localRotation = Quaternion.Euler(newWeaponRotation);
} }
private void SetWeaponAnimation()
{
weaponAnimator.SetBool("isSprinting", characterController.isSprinting);
}
} }