コード例 #1
0
    // Ends the screen transition for a mission retry
    private void EndRetryTransition()
    {
        // Player
        GameManager.Player.ResetPlayer(v3PlayerStartPos);
        // End Goal
        goEndGoal.SetActive(false);

        // Stop and Reset Mission Timer
        missionTimer.StopTimer();
        missionTimer.ResetTimer();

        // Reset Score if it exists
        if (missionScore != null)
        {
            missionScore.ResetScore(true);
        }

        // Disable Mission UI
        goMissionUI.SetActive(false);

        // Camera
        gameCamera.Reset();
        gameCamera.transform.position = v3CameraStartPos;

        // Targets
        iTargets = agoTargets.Length;

        for (int i = 0; i < agoTargets.Length; i++)
        {
            agoTargets[i].SetActive(true);
            agoTargets[i].GetComponent <HealthManager>().Revive();
        }

        // Projectiles in Scene
        GameObject[] projectiles = GameObject.FindGameObjectsWithTag("Projectile");

        for (int i = 0; i < projectiles.Length; i++)
        {
            projectiles[i].SetActive(false);
        }

        // Debris in Scene
        GameObject[] debris = GameObject.FindGameObjectsWithTag("Debris");

        for (int i = 0; i < debris.Length; i++)
        {
            debris[i].SetActive(false);
        }

        vrMenuManager.gameObject.SetActive(true);
        vrMenuManager.GoToScreen("VRStart");
        AudioManager.Instance.StopAllSounds();

        if (onMissionRestart != null)
        {
            onMissionRestart();
        }

        TransitionHelper.TransitionIn(goScreenFadeUI);
    }
コード例 #2
0
 public void EndBattle()
 {
     ResetCounters();
     nextDayTimer.ResetTimer();
 }