protected void OnPickup(PhotonPlayer m_actor, int m_view) { PhotonView view = PhotonView.Find(m_view); if (view != null) { bl_CTFPlayerLogic logic = view.GetComponent <bl_CTFPlayerLogic>(); if (CanBePickedUpBy(logic) == true) { OnPickup(logic); if (PhotonNetwork.player == m_actor) { bool t_send = false;//Prevent call two or more events if (!t_send) { t_send = true; Team oponentTeam; if ((string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey] == Team.Delta.ToString()) { oponentTeam = Team.Recon; } else { oponentTeam = Team.Delta; } bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Obtained at the " + oponentTeam.ToString() + " flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15); } } } } }
public override void OnPickup(bl_CTFPlayerLogic logic) { if (logic.m_PlayerTeam == Team) { if (IsHome() == false) ReturnFlag(); } else m_CarryingPlayer = logic; }
void OnTriggerEnter(Collider collider) { if (collider.tag == "Player") { bl_CTFPlayerLogic logic = collider.gameObject.GetComponent <bl_CTFPlayerLogic>(); if (CanBePickedUpBy(logic) == true) { PickupObject(logic); } } }
void OnCapture(PhotonPlayer m_actor) { m_CarryingPlayer = null; transform.position = m_HomePosition; //Only the player who captures the flag, updates the properties if (PhotonNetwork.player == m_actor) { bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.CaptureTheFlag, (string)PhotonNetwork.player.GetPlayerTeam().ToString(), 777, 15); IncreaseScore(); } }
void OnCapture(PhotonPlayer m_actor) { m_CarryingPlayer = null; transform.position = m_HomePosition; //Only the player who captures the flag, updates the properties if (PhotonNetwork.player == m_actor) { bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Has capture Flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15); IncreaseScore(); } }
public override bool CanBePickedUpBy(bl_CTFPlayerLogic logic) { //If the flag is at its home position, only the enemy team can grab it if (IsHome() == true) return logic.m_PlayerTeam != Team; //If another player is already carrying the flag, no one else can grab it if (m_CarryingPlayer != null) return false; return true; }
public override void OnPickup(bl_CTFPlayerLogic logic) { if (logic.m_PlayerTeam == Team) { if (IsHome() == false) { ReturnFlag(); } } else { m_CarryingPlayer = logic; } }
public override bool CanBePickedUpBy(bl_CTFPlayerLogic logic) { //If the flag is at its home position, only the enemy team can grab it if (IsHome() == true) { return(logic.m_PlayerTeam != Team); } //If another player is already carrying the flag, no one else can grab it if (m_CarryingPlayer != null) { return(false); } return(true); }
void OnDrop(Vector3 position) { m_CarryingPlayer = null; transform.position = position; m_ReturnTimer = ReturnTime; }
public abstract void OnPickup(bl_CTFPlayerLogic logic);
public abstract bool CanBePickedUpBy(bl_CTFPlayerLogic logic);
void PickupObject(bl_CTFPlayerLogic logic) { PhotonView.RPC("OnPickup", PhotonTargets.AllBuffered, PhotonNetwork.player, logic.photonView.viewID); }
void PickupObject(bl_CTFPlayerLogic logic) { PhotonView.RPC("OnPickup", PhotonTargets.AllBuffered, PhotonNetwork.player,logic.photonView.viewID ); }