Ejemplo n.º 1
0
    void SetupPlayer(int player_no)
    {
        Vector3 refPos = RefPoint.transform.position;
        int     r;
        int     c;
        Player  info = app.model.GetPlayer(player_no);

        Utils.GetRCFromID(info.CurrentCell, out r, out c);
        GameObject obj = Instantiate <GameObject>(PlayerPrefab, refPos + new Vector3(r, 0.5f, c), Quaternion.identity);

        obj.name             = "P" + player_no;
        obj.transform.parent = BlocksRoot;
        Dictionary <string, string> param_list = new Dictionary <string, string>();

        param_list.Add("Horizontal", "Horizontal" + obj.name);
        param_list.Add("Vertical", "Vertical" + obj.name);
        param_list.Add("Action", ((player_no == 1)?"right ":"left ") + "ctrl");
        param_list.Add("Id", player_no.ToString());
        ThirdPersonUserControl user_control = obj.GetComponent <ThirdPersonUserControl>();

        user_control.Init(param_list);
        GameCamera.SetPlayer(player_no, obj.transform);
    }