示例#1
0
    // Use this for initialization
    void Awake()
    {
        score = new List<PlayerScoreInfo>();
        GameObject game = GameObject.FindGameObjectWithTag("GameController");
        hud = game.GetComponent<HUDScript>();
        scoreMenu = game.GetComponent<ScoreMenuScript>();
        gameManager = game.GetComponent<GameManagerScript>();
        spawnManager = game.GetComponent<SpawnManagerScript>();

        hud.RegisterScoreKeeper(this);
        scoreMenu.RegisterScoreKeeper(this);
        gameManager.RegisterScoreKeeper(this);
        spawnManager.RegisterScoreKeeper(this);

        ResetScore();
    }