예제 #1
0
 private void Start()
 {
     endGame = false;
     ModulesPool.FillPool(storeData.LoadAvailableModules());
     Pause();
     Spawn();
 }
예제 #2
0
    /// <summary>
    /// Spawn un module
    /// </summary>
    public void Spawn()
    {
        // Au début du jeu
        if (_currentModules.Count == 0)
        {
            GameObject module1 = Instantiate(ModulesPool.GetRandomModule(), startPosition.transform.position, Quaternion.identity);
            GameObject module2 = Instantiate(ModulesPool.GetRandomModule(), module1.transform.position + offset, Quaternion.identity);

            _currentModules.Add(module1);
            _currentModules.Add(module2);
        }
        else
        {
            GameObject module = Instantiate(ModulesPool.GetRandomModule(), _currentModules[0].transform.position + offset, Quaternion.identity);
            _currentModules.Add(module);
        }
    }