Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

PrefabSavingUtil.cs 698B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Reflection;
  3. #if !UNITY_2021_2_OR_NEWER
  4. using UnityEditor.Experimental.SceneManagement;
  5. #endif
  6. using UnityEditor.SceneManagement;
  7. namespace Unity.AI.Navigation.Editor.Tests
  8. {
  9. class PrefabSavingUtil
  10. {
  11. public static void SavePrefab(PrefabStage prefabStage)
  12. {
  13. if (prefabStage == null)
  14. throw new ArgumentNullException();
  15. var savePrefabMethod = prefabStage.GetType().GetMethod("SavePrefab", BindingFlags.NonPublic | BindingFlags.Instance);
  16. if (savePrefabMethod == null)
  17. throw new InvalidOperationException();
  18. savePrefabMethod.Invoke(prefabStage, null);
  19. }
  20. }
  21. }