Exemple #1
0
        /// <summary>
        /// Put current stolen item to this point.
        /// </summary>
        public void OnPutItemButton()
        {
            ThiefController localThief = ThiefController.LocalThief;

            MultiplayRoomManager.Instance.photonView
            .RPC("StealSuccess", PhotonTargets.AllViaServer, PhotonNetwork.player.ID, localThief.ItemInHand.GenPoint.Index);
            localThief.photonView.RPC("PutItemInPoint", PhotonTargets.All);
            PutItemPoint.SetPointPopup(false);

            gameObject.SetActive(false);
        }
Exemple #2
0
        private void OnTriggerExit2D(Collider2D collision)
        {
            if (activated == false)
            {
                return;
            }

            ThiefController thiefPlayer = collision.gameObject.GetComponent <ThiefController>();

            if (thiefPlayer != null && thiefPlayer == ThiefController.LocalThief && thiefPlayer.ItemInHand != null)
            {
                UIManager.Instance.RemovePutItemPopUp();
            }
        }
Exemple #3
0
        public void SetArrestPopUp(GameObject selectedChar, Vector3 point)
        {
            if (gameObject == null || !IsTouchPointValid(point, ConvertToScreenRect(arrestPopUpPanel)))
            {
                return;
            }

            ThiefController maybeThief = selectedChar.GetComponent <ThiefController>();

            arrestPopUp.Set(maybeThief);

            arrestPopUp.transform.position = point;
            arrestPopUp.gameObject.SetActive(true);

            //Debug.Log("Arrest Pop-up Rect: " + ConvertToScreenRect(arrestPopUpPanel));
        }
Exemple #4
0
        private void OnTriggerExit2D(Collider2D collision)
        {
            if (MultiplayRoomManager.Instance.GameState != EGameState.Started ||
                item == null || item.IsStolen)
            {
                return;
            }

            //Only works when local player walks out front of this point
            ThiefController thiefPlayer = collision.gameObject.GetComponent <ThiefController>();

            if (thiefPlayer != null && thiefPlayer == ThiefController.LocalThief && thiefPlayer.ItemInHand == null)
            {
                UIManager.Instance.RemoveStealPopUp();
            }
        }
        private void Awake()
        {
            if (!photonView.isMine)
            {
                return;
            }

            if (localThief != null)
            {
                Debug.LogError("Multiple instantiation of the local thief player.");
                PhotonExtends.Destroy(gameObject);
                return;
            }

            localThief = this;
        }
Exemple #6
0
 public void Set(ThiefController _selectedThief)
 {
     selectedThief = _selectedThief;
 }