Exemplo n.º 1
0
    private void AddNotes(ref SongParser.Notes notes, SongParser.NoteType noteType)
    {
        int _lane = 1;

        if (player.transform.position.y > 0.0f && player.transform.position.y <= 0.5f)
        {
            _lane = 0;
        }
        else if (player.transform.position.y < 0.0f && player.transform.position.y >= -0.5f)
        {
            _lane = 2;
        }

        switch (_lane)
        {
        case 0:
            notes.top = noteType;
            break;

        case 1:
            notes.middle = noteType;
            break;

        case 2:
            notes.bottom = noteType;
            break;
        }
    }
Exemplo n.º 2
0
    // returns appropriate note prefab
    private GameObject GetNotePrefab(SongParser.NoteType noteType, bool isEmpowered)
    {
        GameObject _obj = null;

        switch (noteType)
        {
        case SongParser.NoteType.Fire:
            if (isEmpowered)
            {
                _obj = empoweredFireNote;
            }
            else
            {
                _obj = fireNote;
            }
            break;

        case SongParser.NoteType.Air:
            if (isEmpowered)
            {
                _obj = empoweredAirNote;
            }
            else
            {
                _obj = airNote;
            }
            break;

        case SongParser.NoteType.Water:
            if (isEmpowered)
            {
                _obj = empoweredWaterNote;
            }
            else
            {
                _obj = waterNote;
            }
            break;

        case SongParser.NoteType.Earth:
            if (isEmpowered)
            {
                _obj = empoweredEarthNote;
            }
            else
            {
                _obj = earthNote;
            }
            break;

        default:
            _obj = fireNote;
            break;
        }

        return(_obj);
    }
    /// <summary>
    /// Instantiates a note according to parameter settings.
    /// </summary>
    /// <param name="_noteType">The type of the note to be instantiated.</param>
    /// <param name="_isEmpowered">Determines whether the note is empowered or not.</param>
    private void InstantiateNote(SongParser.NoteType _noteType, bool _isEmpowered)
    {
        GameObject _notePrefab = null;

        switch (_noteType)
        {
        case SongParser.NoteType.Fire:
            if (_isEmpowered)
            {
                _notePrefab = fireNotePrefab;
            }
            else
            {
                _notePrefab = empoweredFireNotePrefab;
            }
            break;

        case SongParser.NoteType.Air:
            if (_isEmpowered)
            {
                _notePrefab = airNotePrefab;
            }
            else
            {
                _notePrefab = empoweredAirNotePrefab;
            }
            break;

        case SongParser.NoteType.Water:
            if (_isEmpowered)
            {
                _notePrefab = waterNotePrefab;
            }
            else
            {
                _notePrefab = empoweredWaterNotePrefab;
            }
            break;

        case SongParser.NoteType.Earth:
            if (_isEmpowered)
            {
                _notePrefab = earthNotePrefab;
            }
            else
            {
                _notePrefab = empoweredEarthNotePrefab;
            }
            break;
        }

        if (_notePrefab != null)
        {
            Instantiate(_notePrefab, instantiatePos, Quaternion.identity);
        }
    }
Exemplo n.º 4
0
    // checks if the note type exists
    private bool IsThereNote(SongParser.NoteType note)
    {
        switch (note)
        {
        case SongParser.NoteType.Fire:
        case SongParser.NoteType.Air:
        case SongParser.NoteType.Water:
        case SongParser.NoteType.Earth:
            // Debug.Log("Return true");
            return(true);

        default:
            return(false);
        }
    }