using Aisu.SIM1.Face.Core;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace Aisu.SIM1.Face.UI.Common
{
///
/// Demo 场景运行时构建器。
///
public sealed class FaceModuleDemoBootstrap : MonoBehaviour
{
#region Unity API
///
/// 执行 Awake 方法。
///
private void Awake()
{
Build();
}
#endregion
///
/// 构建完整 UGUI 页面。
///
public void Build()
{
if (FindObjectOfType() == null)
{
var eventSystem = new GameObject("EventSystem");
eventSystem.AddComponent();
eventSystem.AddComponent();
}
var font = Resources.GetBuiltinResource("Arial.ttf");
var builder = new FaceModuleUiBuilder(font);
var manager = FindObjectOfType() ?? new GameObject("FaceModuleManager").AddComponent();
var canvasGo = FaceModuleUiBuilder.Create("Canvas", transform);
var canvas = canvasGo.AddComponent