I want to pass the list of object in photon.RPC method i.e
List<GameObject> mycards;
List<GameObject> opponentCard;
PhotonView photonView;
void start()
{
//Added some object to both the list;
photonView.RPC("MyMehthod",PhotonTarget.AllBufferedTarget,mycards,opponentCard);
}
[PunRPC]
void MyMethod(List<GameObject> a,List<GameObject> b)
{
// Doing some work here
}
**Please give me any solution possible to do this or if not the list of object how should i pass the singel object?**
This is the Detail Error:
Exception: cannot serialize(): System.Collections.Generic.List1[UnityEngine.GameObject] ExitGames.Client.Photon.Protocol.Serialize (System.IO.MemoryStream dout, System.Object serObject, Boolean setType) ExitGames.Client.Photon.Protocol.SerializeObjectArray (System.IO.MemoryStream dout, System.Object[] objects, Boolean setType) ExitGames.Client.Photon.Protocol.Serialize (System.IO.MemoryStream dout, System.Object serObject, Boolean setType) ExitGames.Client.Photon.Protocol.SerializeHashTable (System.IO.MemoryStream dout, ExitGames.Client.Photon.Hashtable serObject, Boolean setType) ExitGames.Client.Photon.Protocol.Serialize (System.IO.MemoryStream dout, System.Object serObject, Boolean setType) ExitGames.Client.Photon.Protocol.SerializeParameterTable (System.IO.MemoryStream memStream, System.Collections.Generic.Dictionary
2 parameters)
ExitGames.Client.Photon.Protocol.SerializeOperationRequest (System.IO.MemoryStream memStream, Byte operationCode, System.Collections.Generic.Dictionary2 parameters, Boolean setType) ExitGames.Client.Photon.EnetPeer.SerializeOperationToMessage (Byte opc, System.Collections.Generic.Dictionary
2 parameters, EgMessageType messageType, Boolean encrypt)
ExitGames.Client.Photon.EnetPeer.EnqueueOperation (System.Collections.Generic.Dictionary2 parameters, Byte opCode, Boolean sendReliable, Byte channelId, Boolean encrypt, EgMessageType messageType) ExitGames.Client.Photon.PeerBase.EnqueueOperation (System.Collections.Generic.Dictionary
2 parameters, Byte opCode, Boolean sendReliable, Byte channelId, Boolean encrypted)
ExitGames.Client.Photon.PhotonPeer.OpCustom (Byte customOpCode, System.Collections.Generic.Dictionary`2 customOpParameters, Boolean sendReliable, Byte channelId, Boolean encrypt)
ExitGames.Client.Photon.LoadbalancingPeer.OpRaiseEvent (Byte eventCode, System.Object customEventContent, Boolean sendReliable, .RaiseEventOptions raiseEventOptions) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:524)
NetworkingPeer.OpRaiseEvent (Byte eventCode, System.Object customEventContent, Boolean sendReliable, .RaiseEventOptions raiseEventOptions) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1071)
NetworkingPeer.RPC (.PhotonView view, System.String methodName, PhotonTargets target, Boolean encrypt, System.Object parameters) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3063)
PhotonNetwork.RPC (.PhotonView view, System.String methodName, PhotonTargets target, Boolean encrypt, System.Object parameters) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2661)
PhotonView.RpcSecure (System.String methodName, PhotonTargets target, Boolean encrypt, System.Object parameters) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:608)
PhotonView.RPC (System.String methodName, PhotonTargets target, System.Object parameters) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:582)
GameController.InitializeCardAndGiveToAllPlayers () (at Assets/Scripts/MultiPlayerGamePlay/GameController.cs:145)
Connection.OnJoinedRoom () (at Assets/Scripts/MultiPlayerGamePlay/Connection.cs:39)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2049)
NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1873)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:83)