Esempio n. 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);
        }
Esempio n. 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();
            }
        }
Esempio n. 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));
        }
Esempio n. 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();
            }
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
 public void Set(ThiefController _selectedThief)
 {
     selectedThief = _selectedThief;
 }