Unity单元测试指定测试方法的平台
[Test]
[UnityPlatform (RuntimePlatform.WindowsPlayer)]//单个
public void TestMethod1()
{
   Assert.AreEqual(Application.platform, RuntimePlatform.WindowsPlayer);
}

[Test]
[UnityPlatform(exclude = new[] { RuntimePlatform.WindowsEditor })]//多个
public void TestMethod2() {
    Assert.AreEqual(Application.platform, RuntimePlatform.WindowsEditor);
}


UnityPlatform指定在哪些平台才会运行这些测试代码。


首页 我的博客
粤ICP备17103704号