UpdateRotation
How do I use Update Rotation
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
35 | UpdateRotation(); | 1 |
58 | void UpdateRotation() | 2 |
55 | UpdateRotation(); | 3 |
69 | void UpdateRotation() | 4 |
File name: RPGCamera.cs
Copy
30 void LateUpdate()
31 {
32 UpdateDistance();
33 UpdateZoom();
34 UpdatePosition();
35 UpdateRotation();
36 }
File name: RPGCamera.cs
Copy
58 void UpdateRotation()
59 {
60 if( Input.GetMouseButton( 0 ) == true || Input.GetMouseButton( 1 ) == true )
61 {
62 transform.Rotate( 0, Input.GetAxis( "Mouse X" ) * TurnModifier, 0 );
63 }
64
65 if( Input.GetMouseButton( 1 ) == true && Target != null )
66 {
67 Target.rotation = Quaternion.Euler( 0, transform.rotation.eulerAngles.y, 0 );
68 }
69 }
File name: PhotonTransformView.cs
Copy
47 void Update()
48 {
49 if( m_PhotonView == null || m_PhotonView.isMine == true || PhotonNetwork.connected == false )
50 {
51 return;
52 }
53
54 UpdatePosition();
55 UpdateRotation();
56 UpdateScale();
57 }
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 }
UpdateRotation 137 lượt xem
Gõ tìm kiếm nhanh...