Beispiel #1
0
    void Update()
    {
        if (!ConfiguracionGlobal.musica)
        {
            city.Stop();
            volcano.Stop();
            victory.Stop();
            almostThere.Stop();
        }
        if (_controlNave != null)
        {
            if (!_controlNave.Landed() && _controlNave.IsCloseToPlatform())
            {
                if (!almostThere.isPlaying)
                {
                    switch (_controlJuego.GetCurrentLevel())
                    {
                    case Assets.Utilities.Level.None:
                        break;

                    case Assets.Utilities.Level.City:
                        city.Stop();
                        break;

                    case Assets.Utilities.Level.Volcano:
                        volcano.Stop();
                        break;

                    default:
                        break;
                    }

                    almostThere.Play();
                }
            }
            else if (_controlNave.Landed() && !victory.isPlaying)
            {
                almostThere.Stop();
                victory.Play();
            }
            else
            {
                if (!_controlNave.Landed())
                {
                    if (victory.isPlaying)
                    {
                        victory.Stop();
                    }

                    switch (_controlJuego.GetCurrentLevel())
                    {
                    case Assets.Utilities.Level.None:
                        break;

                    case Assets.Utilities.Level.City:
                        if (!city.isPlaying)
                        {
                            city.Play();
                        }
                        break;

                    case Assets.Utilities.Level.Volcano:
                        if (!volcano.isPlaying)
                        {
                            volcano.Play();
                        }
                        break;

                    default:
                        break;
                    }
                    almostThere.Stop();
                }
            }
        }
    }