HoloLens 2 Gait Training
The purpose of this project is to create gait training application.
Loading...
Searching...
No Matches
SingletonMonobehaviour.cs
Go to the documentation of this file.
1using UnityEngine;
2
8public class SingletonMonobehaviour<T> : MonoBehaviour where T : MonoBehaviour
9{
10 private static T g_Instance;
11
12 public static T Instance { get => g_Instance; }
13
14 protected virtual void Awake()
15 {
16 if( g_Instance == null )
17 {
18 g_Instance = this as T;
19 }
20 else
21 {
22 Destroy( gameObject );
23 }
24 }
25}
Abstract class that inherited by all the game managers. All the game managers use singleton since gam...