Ejemplo n.º 1
0
    public IEnumerator CorrectCamera()
    {
        Vector3 diff = geometrySpawn.getCameraLookat(currLevel, playerStartPosOffset) - m_Camera.transform.position;

        diff.z = 0;
        //Debug.Log("correct camera " + m_Camera.transform.position + diff);
        yield return(StartCoroutine(Global.moveToInSecs(m_Camera.gameObject, m_Camera.transform.position + diff, 1)));
    }
Ejemplo n.º 2
0
    private IEnumerator putPuzzlesInPlace()
    {
        yield return(new WaitForSeconds(0.5f));

        StartCoroutine(geometrySpawner.gameController.playCurrentLoop());

        Vector3 startDelta = geometrySpawner.getStartOrigin() + new Vector3(startDistance, 0, 0); //we only need the x here

        GameObject cam = geometrySpawner.getCameraTransform().gameObject;

        StartCoroutine(waitThenMoveCam(cam, 0.6f, new Vector3(startDelta.x + 16 * dx, geometrySpawner.getCameraLookat().y, startDelta.z), 16 * stoneSpawnDeltaTime));

        for (int a = 0; a < 16; a++)
        {
            Vector3 currXDelta = new Vector3(startDelta.x + a * dx + Random.Range(0, dxNoise), 0, 0);
            geometrySpawner.spawnStone(stones, a, type, currXDelta, type != levelType.BASS? new Vector3(0, 0, Random.Range(-geometrySpawner.angleNoise, geometrySpawner.angleNoise)) :
                                       Vector3.zero, puzzleSpawnAssignment[a]);
            yield return(new WaitForSeconds(stoneSpawnDeltaTime));
        }
        currAssignment = puzzleSpawnAssignment;

        yield return(new WaitForSeconds(1f));
    }