PhotonView with ID 0 has no (non-static) method "StartLoadScene" marked with the [PunRPC](C#) or @Pu
Options
I'm sure I've met all the requirements
1. Photon View and MainUI in the same gameObject
2.PhotonServerSetting->RPCs
Neither of these RPC is working properly
1. Photon View and MainUI in the same gameObject
2.PhotonServerSetting->RPCs
Neither of these RPC is working properly
public class MainUI : BaseUI { [SerializeField] PhotonView photonview; // Use this for initialization protected override void InitUIOnAwake() { DontDestroyOnLoad(EventSystem); } protected override void InitDataOnAwake() { photonview = gameObject.AddComponent<PhotonView>(); } [PunRPC] public void OnRoomPlayerUpdate(Player player) { //some method } [PunRPC] public void StartLoadScene() { GameManager.Instance.LoadPlayer(GameData.Instance.localPlayer.CustomProperties["role"].ToString()); } public void StartGame() { photonview.RPC("StartLoadScene", RpcTarget.All); } public void Ready() { photonview.RPC("OnRoomPlayerUpdate", RpcTarget.All, GameData.Instance.localPlayer); } }
0
Answers
-
please help me0
-
OMG,I solved the problem,ID cannot be 00