Exemplo n.º 1
0
    public static GameObject SpawnNote(GameObject notePrefab, GlobalInfo.EnotePos enotePos, GlobalInfo.EnoteType enoteType, float noteTime, Material noteColor)
    {
        GameObject note;
        float      spawnZ   = noteTime * GlobalInfo.G_speed;
        Vector3    spawnPos = GlobalInfo.NOTE_SPAWN_POS[(int)enotePos] + new Vector3(0.0f, 0.0f, spawnZ);

        note = Instantiate(notePrefab, spawnPos, Quaternion.identity);
        note.GetComponent <MeshRenderer>().material = noteColor;
        note.GetComponent <BasicNote>().enotePos    = enotePos;
        note.GetComponent <BasicNote>().enoteType   = enoteType;
        note.GetComponent <BasicNote>().noteTime    = noteTime;
        return(note);
    }
Exemplo n.º 2
0
    //Spawn Note And set Pos due to current Music time
    public GameObject SpawnNote(GameObject notePrefab, GlobalInfo.EnotePos enotePos, GlobalInfo.EnoteType enoteType, float noteTime, Material noteColor, float currentTime)
    {
        GameObject note;
        float      spawnZ   = 0;
        Vector3    spawnPos = new Vector3(GlobalInfo.NOTE_SPAWN_POS[(int)enotePos].x, GlobalInfo.NOTE_SPAWN_POS[(int)enotePos].y, spawnZ);

        note = Instantiate(notePrefab, spawnPos, Quaternion.identity);
        note.transform.parent = spawnNoteParent.transform;
        note.GetComponent <MeshRenderer>().material = noteColor;
        note.GetComponent <BasicNote>().enotePos    = enotePos;
        note.GetComponent <BasicNote>().enoteType   = enoteType;
        note.GetComponent <BasicNote>().noteTime    = noteTime;
        return(note);
    }