Ejemplo n.º 1
0
    void Awake()
    {
        // deal with the singleton part
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
        initMetaHeuristic();
        BatchmodeConfig.HandleArgs(this, metaengine);
        Random.InitState(System.DateTime.Now.Millisecond);
        init();
    }
Ejemplo n.º 2
0
    void Awake()
    {
        // deal with the singleton part
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
        initMetaHeuristic();
        BatchmodeConfig.HandleArgs(this, metaengine);
        Random.InitState(seed);
        Time.timeScale = this.Thetimescale;
        init();
    }
Ejemplo n.º 3
0
    //Awake is always called before any Start functions
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        scoreText.text = "";
        if (restartText)
        {
            restartText.text = "1/1";
        }

        if (gameOverText)
        {
            gameOverText.text = "";
        }

        evolEngine = this.GetComponentInParent <EvolutionState> ();

        BatchmodeConfig.HandleArgs(evolEngine, this);

        lvl = new Level();
        lvl.load(levelNumber);

        evolEngine.populationSize = 50;
        evolEngine.individualSize = lvl.calcNumberOfMoves();
        evolEngine.InitPopulation();

        init();
    }