using System.Collections; using System.Collections.Generic; using UnityEngine; public class WallDirectionTest : MonoBehaviour { // Start is called before the first frame update public GameObject[] sceneObjects; void Start() { foreach (var obj in sceneObjects) { MeshFilter meshFilter = obj.GetComponent(); if (meshFilter != null) { Mesh mesh = meshFilter.mesh; Vector3 normal = mesh.normals[0]; // Получаем нормаль первой вершины (упрощение) DetermineOrientation(normal, obj); } } } void DetermineOrientation(Vector3 normal, GameObject obj) { float threshold = 0.7f; // Порог для определения ориентации if (Mathf.Abs(normal.y) > threshold) { if (normal.y > 0) { } else { } } else if (Mathf.Abs(normal.x) > threshold) { } else if (Mathf.Abs(normal.z) > threshold) { } else { } } }