コード例 #1
0
ファイル: AlgoRandom.cs プロジェクト: CBRZY/Falling-Stars
 public static AlgoRandom Instance(int numberofSpawners)
 {
     if (instance == null)
     {
         instance = new AlgoRandom(numberofSpawners);
     }
     return(instance);
 }
コード例 #2
0
ファイル: MainController.cs プロジェクト: CBRZY/Falling-Stars
    void Start()
    {
        galaxy     = Galaxy.Instance;
        algoRandom = AlgoRandom.Instance(spawners.Length);

        textLevel.text          = galaxy.getLevel().ToString();
        textStarsDestroyed.text = galaxy.getStarsDestroyed().ToString();
        textLives.text          = galaxy.getLives().ToString();

        setTimerDurations(galaxy.getLevel());

        levelTimer  = Timer.Register(levelTimerDuration, () => galaxyLevelUp(), isLooped: true);
        spawnTimer  = Timer.Register(spawnTimerDuration, () => customUpdate(), isLooped: true);
        tenSecTimer = Timer.Register(10f, () => tenSecCheck(), isLooped: true);
    }