コード例 #1
0
        public void InitArrestSetting(SkillUseButton button, int initArrestCount)
        {
            arrestCount  = initArrestCount;
            arrestButton = button;

            arrestButton.SetRemainingCount(ArrestCount);
        }
コード例 #2
0
        public void TryToArrest(int detectiveID, int thiefID)
        {
            if (detectiveID == PhotonNetwork.player.ID)
            {
                arrestButton.SetRemainingCount(--arrestCount);
            }

            if (thiefID == -1)
            {
                uiManager.SetAlert("탐정 " + PhotonPlayer.Find(detectiveID).NickName + "이 도둑 체포 실패!");
                return;
            }

            if (PhotonPlayer.Find(thiefID) == null)
            {
                Debug.LogError("Arrest failed. Wrong Thief ID.");
                return;
            }

            uiManager.SetAlert("도둑 " + PhotonPlayer.Find(detectiveID).NickName + " 체포!");
            arrestedThievesNum += 1;
            uiManager.RenewThievesNum(thievesNum - arrestedThievesNum);

            if (detectiveID == PhotonNetwork.player.ID)
            {
                SetPlayerRecord(curTimestamp - startTimestamp);
            }

            /*if (PhotonNetwork.player.ID == thiefID)
             * {
             *  uiManager.SetObserverModeUI();
             * }*/

            if (thievesNum == arrestedThievesNum)
            {
                PhotonExtends.SetRoomCustomProp(winTeamKey, (int)ETeam.Detective);
                PhotonExtends.SetRoomCustomProp(gameSetKey, true);
            }
        }