예제 #1
0
    public void emitDisk()
    {
        if (gamestate == GameState.BEFORESTART)
        {
        }
        else if (gamestate == GameState.ROUND1)
        {
            disk = diskFactory.getDiskObject();
            float x = Random.Range(0.1f, 1);
            float y = Random.Range(-1, 1) / 10;
            float z = Random.Range(0.1f, 1);

            disk.GetComponent <GameModel>().setColor(selectColor());
            disk.GetComponent <GameModel>().setEmitPosition(new Vector3(-8, 0, 5));
            disk.GetComponent <GameModel>().setEmitDirection(new Vector3(x, y, z));
        }
        else if (gamestate == GameState.ROUND2)
        {
            disk = diskFactory.getDiskObject();
            float x = Random.Range(-0.8f, 1);
            float y = Random.Range(-1, 1) / 10;
            float z = Random.Range(0.1f, 1);
            disk.GetComponent <GameModel>().setColor(selectColor());
            disk.GetComponent <GameModel>().setEmitPosition(new Vector3(-8, 0, 5));
            disk.GetComponent <GameModel>().setEmitDirection(new Vector3(x, y, z));
        }
        else if (gamestate == GameState.END)
        {
            diskFactory.clear();
            scoreRecorder.resetScore();
            //print(cout);
        }
    }