/// <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); }
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(); } }
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)); }
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; }
public void Set(ThiefController _selectedThief) { selectedThief = _selectedThief; }