Exemple #1
0
    /// <summary>
    /// Awake is called at pre-initialization. We use it to report the construction of this instance
    /// to the MatchController.
    /// </summary>
    private void Awake()
    {
        // First, get the match controller.
        matchController = MatchController.GetSingleton() as MatchController;

        // Next, tell the match controller that we exist.
        matchController.AddMatchClient(this);

        // Finally, for organization, place this game object as a child of the match controller.
        transform.parent = matchController.transform;
    }