MeshNav.cs 546 B

12345678910111213141516171819
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using UnityEditor.AI;
  6. public class MeshNav : MonoBehaviour
  7. {
  8. [MenuItem("NavMesh/Build With Slope 90")]
  9. public static void BuildSlope90()
  10. {
  11. SerializedObject obj = new SerializedObject(NavMeshBuilder.navMeshSettingsObject);
  12. SerializedProperty prop = obj.FindProperty("m_BuildSettings.agentSlope");
  13. prop.floatValue = 90.0f;
  14. obj.ApplyModifiedProperties();
  15. NavMeshBuilder.BuildNavMesh();
  16. }
  17. }