Beispiel #1
0
    IEnumerator LoadLastSave(float delay)
    {
        // Debug.Log("mission - load last save point  " + Game.Instance.GameType);

        StartCoroutine(FadeOutMusic(2));


        yield return(new WaitForSeconds(3));

        GuiManager.Instance.FadeOut();

        yield return(new WaitForSeconds(1));

        Player.Instance.Agent.Transform.position = new Vector3(0, -1000, 0);

        yield return(new WaitForSeconds(0.1f));

        //Player.Instance.Agent.CharacterController()

        CurrentGameZone.Reset();
        CurrentGameZone.Disable();

        // Debug.Log("mission - show last obejcts");

        for (int i = 0; i < ManagedGameObject.Length; i++)
        {
            ManagedGameObject[i].SetActiveRecursively(true);
        }

        SpriteEffectsManager.Instance.ReleaseBloodSprites();

        Game.Instance.Save_Load();

        yield return(new WaitForEndOfFrame());

        //Debug.Log("mission - set current zone" + Game.Instance.CurrentGameZone);
        CurrentGameZone = GameZones[Game.Instance.CurrentGameZone];
        CurrentGameZone.Enable();

        //Debug.Log("Respawning player - currentgamezone" + Game.Instance.CurrentGameZone);

        Player.Instance.Agent.SendMessage("Activate", CurrentGameZone.PlayerSpawn.Transform);

        GuiManager.Instance.ShowMessage(GuiManager.E_HudMessageType.E_NONE);

        //  Debug.Log("mission - set music");
        SetNewMusic(SoundDataManager.Instance.CalmMusic, SoundDataManager.Instance.CalmMusicVolume, SoundDataManager.Instance.CalmMusicFadeOutTime, SoundDataManager.Instance.CalmMusicFadeInTime);

        CurrentGameZone.Restart();

        GuiManager.Instance.Reset();

        GuiManager.Instance.FadeIn(2);


        //Debug.Log("mission - loaded");
    }
Beispiel #2
0
    void PrepareForStart()
    {
        //Debug.Log("Respawning - currentgamezone" + CurrentGameZone.gameObject.name );

        //     Game.Instance.ComboLevel = new E_ComboLevel[] { E_ComboLevel.Three, E_ComboLevel.Three, E_ComboLevel.Three, E_ComboLevel.Three, E_ComboLevel.Three, E_ComboLevel.Three };
        //     Game.Instance.SwordLevel = E_SwordLevel.Five;
        //     Game.Instance.HealthLevel = E_HealthLevel.Three;

        Player.Instance.Agent.SendMessage("Activate", CurrentGameZone.PlayerSpawn.Transform);

        Mission.Instance.SetNewMusic(SoundDataManager.Instance.CalmMusic, SoundDataManager.Instance.CalmMusicVolume, SoundDataManager.Instance.CalmMusicFadeOutTime, SoundDataManager.Instance.CalmMusicFadeInTime);

        CurrentGameZone.Restart();

        GuiManager.Instance.Reset();
        GuiManager.Instance.FadeIn(2);
    }