holopy3/Assets/Scripts/Singleton.cs
2020-12-10 15:25:12 +01:00

25 lines
481 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR.InteractionSystem;
public class Singleton : MonoBehaviour
{
private static Singleton _instance;
public static Singleton Instance { get { return _instance; } }
private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(this.gameObject);
}
else
{
_instance = this;
}
}
}