天津23维预案
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.

45 lines
846 B

2 years ago
using UnityEngine;
using System.Collections;
using System.Linq;
using UIWidgets;
namespace UIWidgets.Tests
{
public class SmokeTest : MonoBehaviour {
[SerializeField]
Accordion accordion;
void Start()
{
#if UNITY_STANDALONE
if (System.Environment.GetCommandLineArgs().Contains("-smoke-test"))
{
StartCoroutine(SimpleCheck());
}
#endif
}
IEnumerator SimpleCheck()
{
yield return new WaitForSeconds(5f);
var items = accordion.Items;
if (!accordion.Items[0].Open || !accordion.Items[0].ContentObject.activeSelf)
{
throw new UnityException("Overview is not active!");
}
foreach (var item in items)
{
if (item.ToggleObject.name=="Exit")
{
continue ;
}
accordion.ToggleItem(item);
yield return new WaitForSeconds(5f);
}
Application.Quit();
}
}
}