Exemplo n.º 1
0
    private void Update()
    {
        if (owner == null && Input.GetMouseButtonDown(0) &&
            AuctionManager.GameState == 3 &&//타일 선택 단계일 때
            !AuctionManager.IsWaitMaxPlayer &&
            AuctionManager.maxplayer == AuctionManager.me.GetPlayerName()) //경매 승리자가 클릭 했을 때의 조건을 추가해라
        {
            target = GetClickedObject();                                   //클릭된 오브젝트 저장

            if (target == null)                                            //이상한 곳 클릭했으면 중지.
            {
                return;
            }

            if (target.Equals(gameObject))//만약 자신과 같다면
            {
                //클릭 됬을 때 현재 자원 정보를 해당 타일에 등록
                source = lconstructor.GetSource();

                //ChangeColor();

                amanager.SendSPos(PhotonTargets.All, transform.parent.name, transform.name);

                amanager.SendRAuction(PhotonTargets.MasterClient);
            }
        }

        if (source.SourceName != null)
        {
            ltext.text = source.SourceName + "\n" + (source.SourceMoney * multiple);//보드판에 해당 자원 정보 저장
        }
        ltext.gameObject.transform.position = Camera.main.WorldToScreenPoint(transform.position);
    }
Exemplo n.º 2
0
    public static string maxplayer = string.Empty; //최대 입찰자
    #endregion

    // Use this for initialization
    void Start()
    {
        lconstructor = GameObject.Find("LandConstructor").GetComponent <LandConstructor>();
        cmanager     = GameObject.Find("CardManager").GetComponent <CardManager>();
        startbutton  = GameObject.Find("StartButton");
        endbutton    = GameObject.Find("TurnEnd");
        endbutton.SetActive(false);
        oplayerbutton = GameObject.Find("OtherPlayersButton");
        oplayerbutton.SetActive(false);
        ainfobutton = GameObject.Find("AuctionInfoButton");
        ainfobutton.SetActive(false);
        playerfield = GameObject.Find("PField");
        help        = GameObject.Find("Help");
        help.transform.Find("Scrollbar Vertical").GetComponent <Scrollbar>().value = 1;
        help.SetActive(false);
        chatfield  = GameObject.Find("ChatField");
        turnpname  = "";
        systemtext = GameObject.Find("SystemText").GetComponent <Text>();
        turntext   = GameObject.Find("TurnText").GetComponent <Text>();
        roundtext  = GameObject.Find("RoundText").GetComponent <Text>();
        IsGame     = false;
        //IsAuction = true;
        //IsSelect = false;
        pinfo = new PlayerInfo[PhotonNetwork.playerList.Length];
        price = 0;
        lnum  = -1;

        //처음 위치 저장
        AInfopos = auctiontext.transform.parent.position;

        InitPlayer();

        if (players.Length == 1 || !PhotonNetwork.isMasterClient)
        {
            startbutton.SetActive(false);
        }

        IsPlayersPlayingCard = new bool[players.Length];
        for (int i = 0; i < pinfo.Length; i++)
        {
            IsPlayersPlayingCard[i] = true;
        }
        if (PhotonNetwork.isMasterClient)
        {
            lconstructor.ChangeSource();
            playersprice = new int[players.Length];
            source       = lconstructor.GetSource();//현재 경매에 나온 자원을 받아옴.
            SendSAuction(PhotonTargets.All, source.SourceName, source.SourceMoney);
        }
    }
Exemplo n.º 3
0
 void RestartAuction()
 {
     lconstructor.ChangeSource();
     source = lconstructor.GetSource();
     SendSAuction(PhotonTargets.All, source.SourceName, source.SourceMoney);
 }