Beispiel #1
0
    public int[,,] UpdateMap()
    {
        if (lifeEngine == null)
        {
            if (map == null)
            {
                GenerateInitialGameOfLifeMap();
            }

            lifeEngine = new LifeEngine(map);
        }

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                for (int z = 0; z < depth; z++)
                {
                    map[x, y, z] = lifeEngine.CalcCellInSuperCube(x, y, z);
                }
            }
        }

        return(map);
    }
    void Start()
    {
        timesLeftTexT.gameObject.SetActive(false);

        lifeEngine = FindObjectOfType <LifeEngine>();

        lifeEngine.SetActiveScene("start");
    }
Beispiel #3
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Beispiel #4
0
    void Start()
    {
        Debug.Log("game over scene");
        LanguageSupport langSupport = FindObjectOfType <LanguageSupport>();

        gameOverText.text = langSupport.GetText("gameover");

        tryAgainText.text = langSupport.GetText("tryagain");

        timesLeftTexT.gameObject.SetActive(false);

        lifeEngine = FindObjectOfType <LifeEngine>();

        lifeEngine.SetActiveScene("gameover");
    }
Beispiel #5
0
 void Start()
 {
     GenerateMap();
     lifeEngine = new LifeEngine(map);
     StartCoroutine(UpdateMap());
 }