mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
create visuals for collision objects
This commit is contained in:
parent
706d2b6d9d
commit
18e5ec830a
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@ namespace SanAndreasUnity.Behaviours.World
|
|||
|
||||
[SerializeField] private bool m_createCollisionObjects = false;
|
||||
[SerializeField] private float m_collisionHeight = 20f;
|
||||
[SerializeField] private bool m_createVisualsForCollisionObjects = false;
|
||||
|
||||
[HideInInspector] [SerializeField] private List<Transform> m_renderingObjects = new List<Transform>();
|
||||
[HideInInspector] [SerializeField] private List<Transform> m_collisionObjects = new List<Transform>();
|
||||
|
@ -200,6 +201,14 @@ namespace SanAndreasUnity.Behaviours.World
|
|||
F.DestroyEvenInEditMode(meshCollider.sharedMesh);
|
||||
meshCollider.sharedMesh = mesh;*/
|
||||
|
||||
if (m_createVisualsForCollisionObjects)
|
||||
{
|
||||
var visualGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
Destroy(visualGo.GetComponent<BoxCollider>());
|
||||
visualGo.transform.SetParent(go.transform, false);
|
||||
visualGo.transform.localScale = size;
|
||||
}
|
||||
|
||||
m_collisionObjects.Add(go.transform);
|
||||
|
||||
i++;
|
||||
|
|
Loading…
Reference in a new issue