1 using System.Collections;
2 using System.Collections.Generic;
10 public class AVR_SingletonComponent<T> :
AVR_Component where T : MonoBehaviour
12 public static T Instance {
14 if(_Instance==null) _Instance = FindObjectOfType<T>();
32 if (_Instance != null)
34 AVR_DevConsole.cwarn(this.name +
" is marked as Singleton but another instance was found in the scene. Continuing to use old one.",
this);
38 Instance = gameObject.GetComponent<T>();
42 AVR_DevConsole.cerror(this.name +
" is marked as a Singleton of type " + typeof(T).ToString() +
" but no component of this type was found!",
this);
45 DontDestroyOnLoad(
this);
virtual void OnApplicationQuit()
Base class for all arc-vr components. A component is typically a Monobehaviour that represents a virt...