mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-25 21:40:19 +00:00
use separate collision height for shallow water faces
This commit is contained in:
parent
1af5202779
commit
f08dcb7c3d
1 changed files with 5 additions and 2 deletions
|
@ -16,7 +16,8 @@ namespace SanAndreasUnity.Behaviours.World
|
|||
[SerializeField] private GameObject m_waterCollisionPrefab;
|
||||
|
||||
[SerializeField] private bool m_createCollisionObjects = false;
|
||||
[SerializeField] private float m_collisionHeight = 20f;
|
||||
[SerializeField] private float m_collisionHeight = 200f;
|
||||
[SerializeField] private float m_shallowCollisionHeight = 10f;
|
||||
[SerializeField] private bool m_createVisualsForCollisionObjects = false;
|
||||
|
||||
[HideInInspector] [SerializeField] private List<Transform> m_renderingObjects = new List<Transform>();
|
||||
|
@ -151,8 +152,10 @@ namespace SanAndreasUnity.Behaviours.World
|
|||
if (this.IsInterior(center.y))
|
||||
center.y += Cell.Singleton.interiorHeightOffset;
|
||||
|
||||
bool isShallow = (face.Flags & WaterFlags.Shallow) != 0;
|
||||
|
||||
Vector3 size = max - min;
|
||||
size.y = m_collisionHeight;
|
||||
size.y = isShallow ? m_shallowCollisionHeight : m_collisionHeight;
|
||||
|
||||
return (center, size);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue