Beispiel #1
0
 void Awake()
 {
     if (control == null)
     {
         DontDestroyOnLoad(gameObject);
         control = this;
     }
     else if (control != this)
     {
         Destroy(gameObject);
     }
 }
    void Start()
    {
        instance    = this;
        altura      = 20;
        comprimento = 20;
        btnGera     = GameObject.Find("BtnGera").GetComponent <Button>();
        btnPausa    = GameObject.Find("BtnPausa").GetComponent <Button>();
        btnResolve  = GameObject.Find("BtnResolve").GetComponent <Button>();
        gridBase    = GameObject.Find("GridBase");
        r           = new System.Random();



        StartCoroutine("DesenhaGrid");
    }