forked from homuler/MediaPipeUnityPlugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStartSceneController.cs
More file actions
36 lines (28 loc) · 964 Bytes
/
Copy pathStartSceneController.cs
File metadata and controls
36 lines (28 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
namespace Mediapipe.Unity
{
public class StartSceneController : MonoBehaviour
{
private const string _TAG = nameof(Bootstrap);
[SerializeField] private Image _screen;
[SerializeField] private GameObject _consolePrefab;
private IEnumerator Start()
{
var _ = Instantiate(_consolePrefab, _screen.transform);
var bootstrap = GetComponent<Bootstrap>();
yield return new WaitUntil(() => bootstrap.isFinished);
DontDestroyOnLoad(gameObject);
Logger.LogInfo(_TAG, "Loading the first scene...");
var sceneLoadReq = SceneManager.LoadSceneAsync(1);
yield return new WaitUntil(() => sceneLoadReq.isDone);
}
}
}