SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.2 KiB

4 years ago
  1. # ITestRunSettings
  2. `ITestRunSettings` lets you set any of the global settings right before building a Player for a test run and then reverts the settings afterward.
  3. `ITestRunSettings` implements [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable), and runs after building the Player with tests.
  4. ## Public methods
  5. | Syntax | Description |
  6. | ---------------- | ------------------------------------------------------------ |
  7. | `void Apply()` | A method called before building the Player. |
  8. | `void Dispose()` | A method called after building the Player or if the build failed. |
  9. ## Example
  10. The following example sets the iOS SDK version to be the simulator SDK and resets it to the original value after the run.
  11. ``` C#
  12. public class MyTestSettings : ITestRunSettings
  13. {
  14. private iOSSdkVersion originalSdkVersion;
  15. public void Apply()
  16. {
  17. originalSdkVersion = PlayerSettings.iOS.sdkVersion;
  18. PlayerSettings.iOS.sdkVersion = iOSSdkVersion.SimulatorSDK;
  19. }
  20. public void Dispose()
  21. {
  22. PlayerSettings.iOS.sdkVersion = originalSdkVersion;
  23. }
  24. }
  25. ```