using UnityEngine;
using System.Collections.Generic;

public class GameAccesPoint : MonoBehaviour {

    // ---------- Singelton Pattern ----------
    private static GameAccesPoint _instance;

    public static GameAccesPoint Instance {
        get {
            if (_instance == null) {
                if (!Application.isPlaying)
                    return null;

                _instance = GameObject.FindObjectOfType<GameAccesPoint>();
                if (_instance == null) {
                    GameObject go = new GameObject("AccesPoint");
                    _instance = go.AddComponent<GameAccesPoint>();
                }
                //_instance.Initialize();
            }
            return _instance;
        }
    }
    // ---------- Singelton Pattern ----------

    public TRexGameState tRexState;

    private void Awake() {
        _instance = this;
        DontDestroyOnLoad(_instance);
    }

    private void OnDestroy() {
        _instance = null;
    }
}
