first commit

This commit is contained in:
lethanhsonvsp
2025-11-17 15:36:52 +07:00
commit 6f2eafa33c
14093 changed files with 1253472 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#if UNITY_EDITOR || UNITY_STANDALONE
using System.Collections.Generic;
using NUnit.Framework;
using UnityEditor;
using UnityEngine;
namespace Unity.AI.Navigation.Editor.Tests
{
[TestFixture]
[Description("Verifies that the desired Navigation editor menus are accessible with the package.")]
class NavigationPresenceInMenus
{
GameObject m_ComponentsReceiver;
[OneTimeSetUp]
public void OneTimeSetUp()
{
// Create an empty game object and select it in order for components menus to be available
m_ComponentsReceiver = new GameObject("ComponentsReceiver");
Selection.activeObject = m_ComponentsReceiver;
}
static IEnumerable<string> NavigationMenuItemProvider()
{
yield return "Component/Navigation/Nav Mesh Agent";
yield return "Component/Navigation/Nav Mesh Obstacle";
yield return "Component/Navigation/NavMesh Surface";
yield return "Component/Navigation/NavMesh Modifier Volume";
yield return "Component/Navigation/NavMesh Modifier";
yield return "Component/Navigation/NavMesh Link";
yield return "Window/AI/Navigation";
}
[Test]
[TestCaseSource(nameof(NavigationMenuItemProvider))]
public void MenuIsEnabled(string menuPath)
{
var menuEnabled = Menu.GetEnabled(menuPath);
Assert.That(menuEnabled, Is.True, $"Navigation component menu '{menuPath}' should be available");
}
[OneTimeTearDown]
public void OneTimeTearDown()
{
Object.DestroyImmediate(m_ComponentsReceiver);
}
}
}
#endif