UnityEditor.GameObjectUtility.GetNavMeshAreaFromName C# (CSharp) Method

GetNavMeshAreaFromName() private method

private GetNavMeshAreaFromName ( string name ) : int
name string
return int
        public static extern int GetNavMeshAreaFromName(string name);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]

Usage Example

        private void SelectNavMeshArea()
        {
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = this.m_AreaIndex.hasMultipleDifferentValues;
            string[] navMeshAreaNames = GameObjectUtility.GetNavMeshAreaNames();
            int      intValue         = this.m_AreaIndex.intValue;
            int      selectedIndex    = -1;

            for (int i = 0; i < navMeshAreaNames.Length; i++)
            {
                if (GameObjectUtility.GetNavMeshAreaFromName(navMeshAreaNames[i]) == intValue)
                {
                    selectedIndex = i;
                    break;
                }
            }
            int index = EditorGUILayout.Popup("Navigation Area", selectedIndex, navMeshAreaNames, new GUILayoutOption[0]);

            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                int navMeshAreaFromName = GameObjectUtility.GetNavMeshAreaFromName(navMeshAreaNames[index]);
                this.m_AreaIndex.intValue = navMeshAreaFromName;
            }
        }
All Usage Examples Of UnityEditor.GameObjectUtility::GetNavMeshAreaFromName