|
@@ -1597,33 +1597,41 @@ public class InfraredDemo : JCUnityLib.ViewBase
|
|
|
|
|
|
|
|
public void OnClick_SetAdjustPointsOffset()
|
|
public void OnClick_SetAdjustPointsOffset()
|
|
|
{
|
|
{
|
|
|
- var _sl = ScreenLocate.Main;
|
|
|
|
|
- var buffer = _sl.infraredSpotBuffer;
|
|
|
|
|
- if (buffer != null)
|
|
|
|
|
|
|
+ //var _sl = ScreenLocate.Main;
|
|
|
|
|
+ //var buffer = _sl.infraredSpotBuffer;
|
|
|
|
|
+ //if (buffer != null)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // for (int i = 0; i < buffer.Length; i++)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // if (buffer[i].CameraLocation != null)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Debug.Log("CameraLocation:"+buffer[i].CameraLocation.Value);
|
|
|
|
|
+ // var centerOffset = infraredCameraHelper.GetCenterOffset(buffer[i].CameraLocation.Value, "CameraLocation");
|
|
|
|
|
+ // Debug.Log("CenterOffset: " + centerOffset);
|
|
|
|
|
+ // cameraLocationValue.Set(centerOffset);
|
|
|
|
|
+ // var uvCenterOffset = infraredCameraHelper.GetCenterOffset(buffer[i].ScreenUV.Value, "ScreenUV");
|
|
|
|
|
+ // Debug.Log("UvCenterOffset: " + uvCenterOffset);
|
|
|
|
|
+ // screenUVValue.Set(uvCenterOffset);
|
|
|
|
|
+ // //如果是新手教程场景里面的校准
|
|
|
|
|
+ // InfraredGuider infraredGuiderObj = FindObjectOfType<InfraredGuider>();
|
|
|
|
|
+ // if (infraredGuiderObj != null)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // GameObject infraredGuiderGameObject = infraredGuiderObj.gameObject;
|
|
|
|
|
+ // infraredGuiderGameObject.GetComponent<InfraredGuider>().SetTitleAfterCalibration();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
|
|
+ //只能校准第一个
|
|
|
|
|
+ if (infraredCameraHelper.IsSinglePoint())
|
|
|
{
|
|
{
|
|
|
- for (int i = 0; i < buffer.Length; i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (buffer[i].CameraLocation != null)
|
|
|
|
|
- {
|
|
|
|
|
- Debug.Log("CameraLocation:"+buffer[i].CameraLocation.Value);
|
|
|
|
|
- var centerOffset = infraredCameraHelper.GetCenterOffset(buffer[i].CameraLocation.Value, "CameraLocation");
|
|
|
|
|
- Debug.Log("CenterOffset: " + centerOffset);
|
|
|
|
|
- cameraLocationValue.Set(centerOffset);
|
|
|
|
|
- var uvCenterOffset = infraredCameraHelper.GetCenterOffset(buffer[i].ScreenUV.Value, "ScreenUV");
|
|
|
|
|
- Debug.Log("UvCenterOffset: " + uvCenterOffset);
|
|
|
|
|
- screenUVValue.Set(uvCenterOffset);
|
|
|
|
|
- //如果是新手教程场景里面的校准
|
|
|
|
|
- InfraredGuider infraredGuiderObj = FindObjectOfType<InfraredGuider>();
|
|
|
|
|
- if (infraredGuiderObj != null)
|
|
|
|
|
- {
|
|
|
|
|
- GameObject infraredGuiderGameObject = infraredGuiderObj.gameObject;
|
|
|
|
|
- infraredGuiderGameObject.GetComponent<InfraredGuider>().SetTitleAfterCalibration();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ SetAdjustPointsOffset(PlayerType.FirstPlayer);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ SetAdjustPointsOffset(PlayerType.FirstPlayer);
|
|
|
|
|
+ SetAdjustPointsOffset(PlayerType.SecondPlayer);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 设置存储的中心偏移位置
|
|
/// 设置存储的中心偏移位置
|
|
@@ -1966,6 +1974,13 @@ public class InfraredDemo : JCUnityLib.ViewBase
|
|
|
cameraLocationValue.Set(centerOffset);
|
|
cameraLocationValue.Set(centerOffset);
|
|
|
var uvCenterOffset = infraredCameraHelper.GetCenterOffset(buffer[0].ScreenUV.Value, "ScreenUV");
|
|
var uvCenterOffset = infraredCameraHelper.GetCenterOffset(buffer[0].ScreenUV.Value, "ScreenUV");
|
|
|
screenUVValue.Set(uvCenterOffset);
|
|
screenUVValue.Set(uvCenterOffset);
|
|
|
|
|
+ //如果是新手教程场景里面的校准
|
|
|
|
|
+ InfraredGuider infraredGuiderObj = FindObjectOfType<InfraredGuider>();
|
|
|
|
|
+ if (infraredGuiderObj != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ GameObject infraredGuiderGameObject = infraredGuiderObj.gameObject;
|
|
|
|
|
+ infraredGuiderGameObject.GetComponent<InfraredGuider>().SetTitleAfterCalibration();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|