Files
TowerDefence/My project/Library/PackageCache/com.unity.ai.navigation@5218e4bf7edc/Tests/Editor/PrefabSavingUtil.cs
Caleb Sandford deQuincey 334021d04e Started project
2025-11-14 17:30:41 +00:00

22 lines
617 B
C#

using System;
using System.Reflection;
using UnityEditor.SceneManagement;
namespace Unity.AI.Navigation.Editor.Tests
{
class PrefabSavingUtil
{
public static void SavePrefab(PrefabStage prefabStage)
{
if (prefabStage == null)
throw new ArgumentNullException();
var savePrefabMethod = prefabStage.GetType().GetMethod("SavePrefab", BindingFlags.NonPublic | BindingFlags.Instance);
if (savePrefabMethod == null)
throw new InvalidOperationException();
savePrefabMethod.Invoke(prefabStage, null);
}
}
}