コード例 #1
0
ファイル: GameManager.cs プロジェクト: leelnfei/Radius
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);
        networkView.group = 1;

        this.scoreManager.OnScoreUpdated += (sender, e) => {
            // Check if the score limit was reached.
            // Someone may have won
            if (e.ScoreData.value > this.ScoreLimit)
            {
                this.EndGame();
            }
        };

        this.OnGameStarted += (sender) => {
            // Reset the game time when the game starts
            this.CurrentGameTime = 0f;
        };

        this.OnGameEnded += (sender) => {
            // Switch to the empty scene once the game ends
            this.ChangeLevel("empty_scene");
        };
    }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: SuperStarPL/Radius
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);
        networkView.group = 1;

        this.scoreManager.OnScoreUpdated += (sender, e) => {
            // Check if the score limit was reached.
            // Someone may have won
            if(e.ScoreData.value > this.ScoreLimit)
                this.EndGame();
        };

        this.OnGameStarted += (sender) => {
            // Reset the game time when the game starts
            this.CurrentGameTime = 0f;
        };

        this.OnGameEnded += (sender) => {
            // Switch to the empty scene once the game ends
            this.ChangeLevel("empty_scene");
        };
    }