Пример #1
0
        static void Unregister(WalkableArea surface)
        {
            s_NavMeshSurfaces.Remove(surface);

            if (s_NavMeshSurfaces.Count == 0)
            {
                NavMesh.onPreUpdate -= UpdateActive;
            }
        }
Пример #2
0
        static void Register(WalkableArea surface)
        {
            if (s_NavMeshSurfaces.Count == 0)
            {
                NavMesh.onPreUpdate += UpdateActive;
            }

            if (!s_NavMeshSurfaces.Contains(surface))
            {
                s_NavMeshSurfaces.Add(surface);
            }
        }