Mesh by script: problem with collisions (fliped normals?)

I generate mesh by script, and later I find some collisions with this mesh.
I can find collision (using Raycast) only with one side of triangle and that’s ok, but the problem is, some of my triangles are in one order, some in another (it depends on order of adding vertices to this triangle) and I have no idea how to flip this triangle. I was trying to flip normals of some triangles, but it doesn’t affect to collisions at all.
Thank you for help.

I solved this, by creating another mesh with inverted triangles. Not the best solution, but the only one that works.