SynchronizeEnabled
How do I use Synchronize Enabled
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: PhotonTransformViewEditor.cs
Copy
84 private void SetupSerializedProperties()
85 {
86 this.m_SynchronizePositionProperty = serializedObject.FindProperty("m_PositionModel.SynchronizeEnabled");
87 this.m_SynchronizeRotationProperty = serializedObject.FindProperty("m_RotationModel.SynchronizeEnabled");
88 this.m_SynchronizeScaleProperty = serializedObject.FindProperty("m_ScaleModel.SynchronizeEnabled");
89 }
File name: PhotonTransformView.cs
Copy
59 void UpdatePosition()
60 {
61 if( m_PositionModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false )
62 {
63 return;
64 }
65
66 transform.localPosition = m_PositionControl.UpdatePosition( transform.localPosition );
67 }
File name: PhotonTransformView.cs
Copy
69 void UpdateRotation()
70 {
71 if( m_RotationModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false )
72 {
73 return;
74 }
75
76 transform.localRotation = m_RotationControl.GetRotation( transform.localRotation );
77 }
File name: PhotonTransformView.cs
Copy
79 void UpdateScale()
80 {
81 if( m_ScaleModel.SynchronizeEnabled == false || m_ReceivedNetworkUpdate == false )
82 {
83 return;
84 }
85
86 transform.localScale = m_ScaleControl.GetScale( transform.localScale );
87 }
File name: PhotonTransformViewPositionControl.cs
Copy
163 public void OnPhotonSerializeView( Vector3 currentPosition, PhotonStream stream, PhotonMessageInfo info )
164 {
165 if( m_Model.SynchronizeEnabled == false )
166 {
167 return;
168 }
169
170 if( stream.isWriting == true )
171 {
172 SerializeData( currentPosition, stream, info );
173 }
174 else
175 {
176 DeserializeData( stream, info );
177 }
178
179 m_LastSerializeTime = PhotonNetwork.time;
180 m_UpdatedPositionAfterOnSerialize = false;
181 }
File name: PhotonTransformViewRotationControl.cs
Copy
28 public void OnPhotonSerializeView( Quaternion currentRotation, PhotonStream stream, PhotonMessageInfo info )
29 {
30 if( m_Model.SynchronizeEnabled == false )
31 {
32 return;
33 }
34
35 if( stream.isWriting == true )
36 {
37 stream.SendNext( currentRotation );
38 }
39 else
40 {
41 m_NetworkRotation = (Quaternion)stream.ReceiveNext();
42 }
43 }
File name: PhotonTransformViewScaleControl.cs
Copy
28 public void OnPhotonSerializeView( Vector3 currentScale, PhotonStream stream, PhotonMessageInfo info )
29 {
30 if( m_Model.SynchronizeEnabled == false )
31 {
32 return;
33 }
34
35 if( stream.isWriting == true )
36 {
37 stream.SendNext( currentScale );
38 }
39 else
40 {
41 m_NetworkScale = (Vector3)stream.ReceiveNext();
42 }
43 }
SynchronizeEnabled 121 lượt xem
Gõ tìm kiếm nhanh...