OnSerializeMethodInfos









How do I use On Serialize Method Infos
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonView.cs Copy
507     internal protected void ExecuteComponentOnSerialize( Component component, PhotonStream stream, PhotonMessageInfo info )
508     {
509         if( component != null )
510         {
511             if( m_OnSerializeMethodInfos.ContainsKey( component ) == false )
512             {
513                 MethodInfo newMethod = null;
514                 bool foundMethod = NetworkingPeer.GetMethod( component as MonoBehaviour, PhotonNetworkingMessage.OnPhotonSerializeView.ToString(), out newMethod );
515
516                 if( foundMethod == false )
517                 {
518                     Debug.LogError( "The observed monobehaviour (" + component.name + ") of this PhotonView does not implement OnPhotonSerializeView()!" );
519                     newMethod = null;
520                 }
521
522                 m_OnSerializeMethodInfos.Add( component, newMethod );
523             }
524
525             if( m_OnSerializeMethodInfos[ component ] != null )
526             {
527                 m_OnSerializeMethodInfos[ component ].Invoke( component, new object[] { stream, info } );
528             }
529         }
530     }

OnSerializeMethodInfos 116 lượt xem

Gõ tìm kiếm nhanh...