예제 #1
0
    private void CmdInitialisePlayer()
    {
        id = FindObjectsOfType <Player>().Length - 1;
        RegisterModel(PLAYER_TAG, id);

        GameController gameController = GameObject.FindGameObjectWithTag(GameController.GAME_CONTROLLER_TAG).GetComponent <GameController>();

        gameController.DeactiveScreenCamera();

        Transform transform = gameController.GetPlayerTransform(id);

        RpcSetPlayerTransform(transform.position, transform.rotation);
        myTeamId = gameController.GetMyTeamControllerId(id);

        tag = PLAYER_TAG + " " + myTeamId;

        RpcSetRenderTexture(myTeamId);

        opponentsTeamId = gameController.GetOpponentsTeamControllerId(id);

        laneId = (myTeamId == TeamController.TEAM1)
            ? (id / 2)
            : (id - 1) / 2;

        SpawnController spawnController = GameObject.FindGameObjectWithTag(SpawnController.SPAWN_CONTROLLER_TAG).GetComponent <SpawnController>();

        for (int i = 0; i <= 2; i++)
        {
            RpcSetCrossbowTargets(spawnController.CalculateDefaultCrossbowTarget(i, laneId, myTeamId));
        }

        RpcHighlightSector(myTeamId, laneId);
    }