Ejemplo n.º 1
0
    public void CheckNetUnitDie(PlayerUnit unit)
    {
        if (!PhotonNetwork.connected || PhotonNetwork.room == null || PhotonNetwork.room.PlayerCount < PhotonNetwork.room.MaxPlayers)
        {
            return;
        }

        if (unit == null || unit.GetAct() != E_ACT.DIE || unit.photonView == null)
        {
            return;
        }

        if (StageMgr.Inst.photonView == null)
        {
            return;
        }

        if (unit.photonView.owner == PhotonNetwork.player)
        {
            Debug.Log("Player Death");
            MultyManager.Inst.ShowMessage("You Lose");
            StageMgr.Inst.GameOver();
        }
        else
        {
            Debug.Log("Ohter Death");
            MultyManager.Inst.ShowMessage("You Win");
            StageMgr.Inst.ClearStage();
        }
    }