Example #1
0
    public void Die(string AttackerName) //죽을때 공격한사람 이름을 받아 로그띄울때 씀
    {
        if (isPlay)
        {
            if (AttackerName==PhotonNetwork.NickName)
            {
                InGameNetwork.instance.PV.RPC("ChatRPC", RpcTarget.All, 
                    PhotonNetwork.NickName+"<color=red> Suicided </color>");   
            }
            else
            {
                InGameNetwork.instance.PV.RPC("ChatRPC", RpcTarget.All, 
                    AttackerName+"<color=red> Killed </color>"+ nickname.text);      
            }

            GetComponent<PassiveItem>().StopLader();
            playerItem.Dead();
            gunSetfalse();
            isDeadFunc();
            canMove = false; 
            if(PhotonNetwork.OfflineMode) 
                DieRPC();
            else
                pv.RPC("DieRPC",RpcTarget.All);
            SetAnimRPC(2);
            if(PhotonNetwork.OfflineMode) 
                net.GameOver();
            else
            {
                int remainPlayerCount = 1;
                Player[] players = FindObjectsOfType<Player>();
                foreach (Player pp in players)
                {
                    if (!pp.isDead)
                        remainPlayerCount++;
                }
                net.GameOver2(remainPlayerCount);
            }
        }
        else
        {
           StartCoroutine(mainDie()); 
        }
    }