VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
AVR_Root.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEngine.XR;
5 using System.Linq;
6 
7 
8 namespace AVR.Core {
9  /// <summary>
10  /// Root object of the arc-vr-core library. Functions as a Singleton.
11  /// </summary>
12  [AVR.Core.Attributes.DocumentationUrl("class_a_v_r_1_1_core_1_1_a_v_r___root.html")]
13  public class AVR_Root : Singleton<AVR_Root>
14  {
15  [RuntimeInitializeOnLoadMethod]
16  static void Init()
17  {
18  if(Instance==null) {
19  AVR_DevConsole.cwarn("No AVR_Root component is present. Creating one at runtime.", "AVR_Root");
20  var root = AVR.Core.Utils.Misc.CreateEmptyGameObject("Root");
21  root.gameObject.AddComponent<AVR_Root>();
22  }
23  }
24 
25  public void ReEnableAtEndOfFrame(GameObject obj) {
26  StartCoroutine(_ReEnableAtEndOfFrame(obj));
27  }
28 
29  private IEnumerator _ReEnableAtEndOfFrame(GameObject obj) {
30  yield return new WaitForEndOfFrame();
31  obj.SetActive(true);
32  }
33  }
34 }
static void Init()
Definition: AVR_Root.cs:16
IEnumerator _ReEnableAtEndOfFrame(GameObject obj)
Definition: AVR_Root.cs:29
Sets the documentation html file inside of Packages/com.avr.core/Documentation/html of a given class...
void ReEnableAtEndOfFrame(GameObject obj)
Definition: AVR_Root.cs:25
Root object of the arc-vr-core library. Functions as a Singleton.
Definition: AVR_Root.cs:13