12345678910111213141516171819 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEditor;
- using UnityEditor.AI;
- public class MeshNav : MonoBehaviour
- {
- [MenuItem("NavMesh/Build With Slope 90")]
- public static void BuildSlope90()
- {
- SerializedObject obj = new SerializedObject(NavMeshBuilder.navMeshSettingsObject);
- SerializedProperty prop = obj.FindProperty("m_BuildSettings.agentSlope");
- prop.floatValue = 90.0f;
- obj.ApplyModifiedProperties();
- NavMeshBuilder.BuildNavMesh();
- }
- }
|