complete project reorganization
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 55s
Create tag and build when new code gets to main / Test (push) Successful in 7m7s
Create tag and build when new code gets to main / Export (push) Successful in 9m56s

This commit is contained in:
2026-02-04 11:20:00 +01:00
parent b6e8d0b590
commit cd519e528f
824 changed files with 397 additions and 16380 deletions

View File

@@ -0,0 +1,52 @@
using Godot;
namespace Movementtests.player_controller.Scripts;
public partial class CapsuleCollider : CollisionShape3D
{
[Export(PropertyHint.Range, "0,5.0,0.01,suffix:m,or_greater")]
public float CapsuleDefaultHeight { get; set; } = 2.0f;
[Export(PropertyHint.Range, "0,5.0,0.01,suffix:m,or_greater")]
public float CapsuleCrouchHeight { get; set; } = 1.0f;
public float GetCurrentHeight() { return _shape.Height; }
public float GetDefaultHeight() { return CapsuleDefaultHeight; }
private CapsuleShape3D _shape;
public override void _Ready()
{
_shape = Shape as CapsuleShape3D;
_shape.Height = CapsuleDefaultHeight;
}
public bool IsCapsuleHeightLessThanNormal()
{
return _shape.Height < CapsuleDefaultHeight;
}
public bool IsBetweenCrouchingAndNormalHeight()
{
return _shape.Height > CapsuleCrouchHeight && _shape.Height < CapsuleDefaultHeight;
}
public bool IsDefaultHeight()
{
return Mathf.IsEqualApprox(_shape.Height, CapsuleDefaultHeight);
}
public bool IsCrouchingHeight()
{
return Mathf.IsEqualApprox(_shape.Height, CapsuleCrouchHeight);
}
public void Crouch()
{
_shape.Height = CapsuleCrouchHeight;
}
public void Uncrouch()
{
_shape.Height = CapsuleDefaultHeight;
}
}