Пример #1
0
 /// <summary>
 /// 对象跟随相机
 /// </summary>
 private void OnObjectFollowCamera(FollowInfo info)
 {
     if (info.followTarget != null && info.cameraTarget != null)
     {
         var velocity = info.followTarget.position;
         var x        = info.cameraTarget.position.x * info.offset_x;
         info.followTarget.position = new Vector3(x, velocity.y, velocity.z);
     }
 }
Пример #2
0
 /// <summary>
 /// 相机跟随角色
 /// </summary>
 private void OnCameraFollowRole(FollowInfo info)
 {
     if (info.followTarget != null && info.cameraTarget != null)
     {
         var velocity = info.followTarget.position;
         velocity.y = info.cameraTarget.position.y;
         info.cameraTarget.position = velocity;
     }
 }