WasSynchronizeTypeChanged









How do I use Was Synchronize Type Changed
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonAnimatorView.cs Copy
189     public void SetLayerSynchronized( int layerIndex, SynchronizeType synchronizeType )
190     {
191         if( Application.isPlaying == true )
192         {
193             m_WasSynchronizeTypeChanged = true;
194         }
195
196         int index = m_SynchronizeLayers.FindIndex( item => item.LayerIndex == layerIndex );
197
198         if( index == -1 )
199         {
200             m_SynchronizeLayers.Add( new SynchronizedLayer { LayerIndex = layerIndex, SynchronizeType = synchronizeType } );
201         }
202         else
203         {
204             m_SynchronizeLayers[ index ].SynchronizeType = synchronizeType;
205         }
206     }
File name: PhotonAnimatorView.cs Copy
213     public void SetParameterSynchronized( string name, ParameterType type, SynchronizeType synchronizeType )
214     {
215         if( Application.isPlaying == true )
216         {
217             m_WasSynchronizeTypeChanged = true;
218         }
219
220         int index = m_SynchronizeParameters.FindIndex( item => item.Name == name );
221
222         if( index == -1 )
223         {
224             m_SynchronizeParameters.Add( new SynchronizedParameter { Name = name, Type = type, SynchronizeType = synchronizeType } );
225         }
226         else
227         {
228             m_SynchronizeParameters[ index ].SynchronizeType = synchronizeType;
229         }
230     }
File name: PhotonAnimatorView.cs Copy
432     void OnPhotonSerializeView( PhotonStream stream, PhotonMessageInfo info )
433     {
434         if( m_Animator == null )
435         {
436             return;
437         }
438
439         if( stream.isWriting == true )
440         {
441             if( m_WasSynchronizeTypeChanged == true )
442             {
443                 m_StreamQueue.Reset();
444                 SerializeSynchronizationTypeState( stream );
445
446                 m_WasSynchronizeTypeChanged = false;
447             }
448
449             m_StreamQueue.Serialize( stream );
450             SerializeDataDiscretly( stream );
451         }
452         else
453         {
454#if PHOTON_DEVELOP
455             if( ReceivingSender != null )
456             {
457                 ReceivingSender.OnPhotonSerializeView( stream, info );
458             }
459             else
460#endif
461             {
462                 if( stream.PeekNext() is byte[] )
463                 {
464                     DeserializeSynchronizationTypeState( stream );
465                 }
466
467                 m_StreamQueue.Deserialize( stream );
468                 DeserializeDataDiscretly( stream );
469             }
470         }
471     }

WasSynchronizeTypeChanged 154 lượt xem

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