/**************************************************************************** * Copyright 2019 Nreal Techonology Limited. All rights reserved. * * This file is part of NRSDK. * * https://www.nreal.ai/ * *****************************************************************************/ using System.Collections; using UnityEngine; namespace NRKernal.NRExamples { /// Panel for editing the user define. [HelpURL("https://developer.nreal.ai/develop/unity/customize-phone-controller")] public class UserDefinePanel : MonoBehaviour { /// The user define panel. public GameObject m_UserDefinePanel; /// Starts this object. void Start() { StartCoroutine(RigistUserDefinePanel()); } /// Rigist user define panel. /// An IEnumerator. private IEnumerator RigistUserDefinePanel() { while (GameObject.FindObjectOfType() == null) { yield return new WaitForEndOfFrame(); } var virtualdisplayer = GameObject.FindObjectOfType(); if (virtualdisplayer.transform.GetComponentInChildren() == null) { yield break; } var root = virtualdisplayer.transform.GetComponentInChildren().transform; Instantiate(m_UserDefinePanel, root); } } }