Example #1
0
    public void SpawnCoins(int coinsCount)
    {
        fdet = FindObjectOfType <FuncionDeTrayectoria>();

        for (int i = 0; i < coinsCount; i++)
        {
            Instantiate(monedaGO, fdet.Trajectory(i), Quaternion.identity);
        }
    }
Example #2
0
    // Start is called before the first frame update
    public void SpawnEnemies(int enemiesCount, float spawnOffset)
    {
        fdet = FindObjectOfType <FuncionDeTrayectoria>();

        for (int i = 0; i < enemiesCount; i++)
        {
            Enemigo e = Instantiate(enemigoGO, fdet.Trajectory(i + 1, 0, true), Quaternion.identity).GetComponent <Enemigo>();
            e.positionIndex = i + 2;
        }
    }
Example #3
0
    public void DrawOrbit()
    {
        FuncionDeTrayectoria fdet = FindObjectOfType <FuncionDeTrayectoria>();

        lineRenderer = GetComponent <LineRenderer>();
        lineRenderer.positionCount = resolucion + 1;

        for (int i = 0; i <= resolucion; i++)
        {
            lineRenderer.SetPosition(i, fdet.Trajectory(i));
        }
    }
Example #4
0
    private void StartLevel()
    {
        soundManager.PlaySound("Game Play Mx");
        trajectory = Instantiate(currentLevel.trajectory);
        fdet       = trajectory.GetComponent <FuncionDeTrayectoria>();
        FuncionDeTrayectoria.maxIndex = fdet.points.Count - 1;

        orbit.DrawOrbit();

        SpawnPlayer();

        coinSpawner.SpawnCoins(currentLevel.coinsCount);
        enemySpawner.SpawnEnemies(currentLevel.enemiesCount, currentLevel.spawnOffset);
    }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     fdet = FindObjectOfType <FuncionDeTrayectoria>();
 }
Example #6
0
 private void Start()
 {
     fdet         = FindObjectOfType <FuncionDeTrayectoria>();
     soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();
 }