暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PostBuildCleanupAttribute.cs 1.4KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. namespace UnityEngine.TestTools
  3. {
  4. /// <summary>
  5. /// PostBuildCleanup attributes run if the respective test or test class is in the current test run. The test is included either by running all tests or setting a [filter](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/workflow-create-test.html#filters) that includes the test. If multiple tests reference the same pre-built setup or post-build cleanup, then it only runs once.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
  8. public class PostBuildCleanupAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// Initializes and returns an instance of PostBuildCleanupAttribute by type.
  12. /// </summary>
  13. /// <param name="targetClass">The type of the target class.</param>
  14. public PostBuildCleanupAttribute(Type targetClass)
  15. {
  16. TargetClass = targetClass;
  17. }
  18. /// <summary>
  19. /// Initializes and returns an instance of PostBuildCleanupAttribute by class name.
  20. /// </summary>
  21. /// <param name="targetClassName">The name of the target class.</param>
  22. public PostBuildCleanupAttribute(string targetClassName)
  23. {
  24. TargetClass = AttributeHelper.GetTargetClassFromName(targetClassName, typeof(IPostBuildCleanup));
  25. }
  26. internal Type TargetClass { get; private set; }
  27. }
  28. }