void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
Beispiel #2
0
    IEnumerator GameReset()
    {
        DeathCanvas.SetActive(true);
        yield return(new WaitForSeconds(3));

        SceneManager.LoadScene("Main Menu");
        DoNotDes[] Gos = Fs <DoNotDes>();
        DoNotDes.Created = false;
        foreach (DoNotDes go in Gos)
        {
            if (go.gameObject != gameObject)
            {
                D(go.gameObject);
            }
        }
        yield return(new WaitForSeconds(0));

        D(gameObject);
    }
Beispiel #3
0
 void Start()
 {
     Instance = this;
     gameObject.SetActive(false);
     GetComponent <CanvasGroup>().alpha = 1.0f;
 }
Beispiel #4
0
 void spawnDC()
 {
     dc   = Instantiate(deadCanvas);
     dcdc = dc.GetComponent <DeathCanvas> ();
     dc.SetActive(false);
 }