Photon

Pun RPC 호출 스크립트

뽐타 2022. 9. 29. 17:35
public class Destroy : MonoBehaviour

{
    private PhotonView photonView;

    void Start()
    {
        photonView = PhotonView.Get(this);

    }
    
    //해당 함수를 호출하면 RPC호출이 된다.
    public void destroyThis()
    {
        photonView.RPC("destroyThisRPC", RpcTarget.All);
    }

	//RPC호출
    [PunRPC]
    public void destroyThisRPC()
    {
        Debug.Log("destroyThis 함수 실행");

    }

    

}