How to manage a round based game?

As far as I understood scripts in unity are always (?) attached to game objects. But how can I create a script that observes the current running round or level of a game and detect changes in it’s state?

Like I want to have for example 3 players, when one finishes his move the next player should be able to move his pawn. Would I attach this script also to some game object?

Also how do I bring all the UI stuff together? Like my 3 players are in the same team and their pawns character portraits should be shown in a list. If there are only two show two, if there are three, show three.

I’m mostly interested in how I an “connect” all these things.

Firstly you can attach all the scripts to an Empty game object and then call it “Manager” for example , and for connecting you can use the SendMessage from Unity , it helps you a lot to send orders from a script to another , and sure because your numbers changes in addition to lots of factors you will use a ( Static Variables ) ; it is a pretty rough answer but it is the main guide lines which you need, if you need a big explanation to any of that , just tell here & i`ll give

cheers
M:)

The easiest approach is to have a manager of some sort. The manager is just a script attached to a GameObject which preferably doesn't destroy on loading new levels. All variables and functions could be static inside the manager so you just have to call something like: `GameManager.NextPlayerMove();`

//Inside the script called GameManager you can have something like:

static var currentPlayer : int = 0;
static var activePlayers : int = 3;

static function NextPlayerMove () {
    if (currentPlayer<activePlayers) {
        currentPlayer++;
    } else {
        currentPlayer = 0;
    }
}

You'd increase the activePlayers when somebody joins or drops out in the same way via a function.

Regarding the UI stuff you'd use a for-loop for each player.

function OnGUI () {
    for (var i : int = 0; i < GameManager.activePlayers; i++) {
        //Each player's avatar here
    }
}

Check out the GUI Scripting Guide to see what you can do.