Esempio n. 1
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            _instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
        GM.Instance.ingameCanvas = this;
        this.hideAllKeycards();
        this.gameObject.SetActive(false);
    }
Esempio n. 2
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            _instance = this;
        }

        if (transform.parent == null)
        {
            DontDestroyOnLoad(this);
        }

        SceneManager.sceneLoaded += OnSceneLoaded;

        if (ingameCanvas == null)
        {
            ingameCanvas = GameObject.FindObjectOfType <IngameCanvas>();
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Awake()
 {
     ingamecanvas = this;
 }