예제 #1
0
    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
        if (stream.isWriting)
        {
            stream.SendNext(attackDamage);
            stream.SendNext(charaNumber);
        }
        else
        {
            attackDamage = (int)stream.ReceiveNext();
            charaNumber  = (int)stream.ReceiveNext();

            if (attackManager == null)
            {
                attackManager = GameObject.Find("AttackManager").GetComponent <AttackManager>();
            }

            attackManager.Attacked(attackDamage);
        }
    }