コード例 #1
0
ファイル: SceneController.cs プロジェクト: talyh/Rutzer
    public void Return()
    {
        SceneManager.LoadScene(_previousScene);
        Persistency.SaveData(Persistency.DataGroups.Sound);

        // if (instance._previousScene != SceneManager.GetActiveScene().buildIndex)
        // {
        //     instance._previousScene = SceneManager.GetActiveScene().buildIndex;
        // }
    }
コード例 #2
0
ファイル: Checkpoint.cs プロジェクト: pLawitzki/GRAIL
    void OnTriggerEnter(Collider other)
    {
        if (!shine.activeSelf)
        {
            shine.SetActive(true);
            particle.Play();
            audio.Play();

            Persistency.SetCheckpoint(gameObject);
        }
    }
コード例 #3
0
ファイル: Persistency.cs プロジェクト: pLawitzki/GRAIL
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
        instance         = this;
        checkpointLevel  = Application.loadedLevel;
        checkpointStatue = GameObject.Find("Checkpoint");
    }
コード例 #4
0
    public void GameOver()
    {
        // if game has ended, check for new highscores to be saved and load the Game Over Scene
        _gameOver = true;

        if (_score > _highScore)
        {
            _highScore = _score;
            Persistency.SaveData(Persistency.DataGroups.Score);
            _newRecord = true;
        }

        StartCoroutine(WaitForPlayerDeathEffects());
    }
コード例 #5
0
 public Persistent(Persistency persistency)
 {
     Persistency = persistency;
 }
コード例 #6
0
ファイル: SoundController.cs プロジェクト: talyh/Rutzer
 private void Start()
 {
     Persistency.LoadSavedData(Persistency.DataGroups.Sound);
 }
コード例 #7
0
ファイル: CharacterMover.cs プロジェクト: pLawitzki/GRAIL
 void OnDeath()
 {
     Persistency.OnDeath();
     Destroy(gameObject);
 }
コード例 #8
0
    private void ChooseCanvas()
    {
        // enable the appropriate canvas based on Scene type, or hide them all if the Scene type is not recognized

        switch (SceneController.instance.currentSceneType)
        {
        case SceneController.SceneTypes.Start:
        {
            _startScreenCanvas.SetActive(true);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            break;
        }

        case SceneController.SceneTypes.Instructions:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(true);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            break;
        }

        case SceneController.SceneTypes.Options:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(true);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            break;
        }

        case SceneController.SceneTypes.Credits:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(true);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            break;
        }

        case SceneController.SceneTypes.Level:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(true);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            Persistency.LoadSavedData(Persistency.DataGroups.Score);
            break;
        }

        case SceneController.SceneTypes.GameOver:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(true);
            _pauseMenuCanvas.SetActive(false);
            ShowGameOverResult(GameController.instance.newRecord);
            break;
        }

        default:
        {
            _startScreenCanvas.SetActive(false);
            _instructionsScreenCanvas.SetActive(false);
            _optionsScreenCanvas.SetActive(false);
            _creditsScreenCanvas.SetActive(false);
            _levelScreenCanvas.SetActive(false);
            _gameOverScreenCanvas.SetActive(false);
            _pauseMenuCanvas.SetActive(false);
            break;
        }
        }
    }
コード例 #9
0
 public void EnableSceneCanvas()
 {
     ChooseCanvas();
     LinkCanvasElements();
     Persistency.LoadSavedData(Persistency.DataGroups.Sound);
 }
コード例 #10
0
ファイル: PersistentAttribute.cs プロジェクト: CHMP-HLab/HLab
 public PersistentAttribute(Persistency persistency)
 {
     Persistency = persistency;
 }