|
@@ -115,6 +115,9 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
[SerializeField]
|
|
[SerializeField]
|
|
|
GameObject LayoutAutoEnd;
|
|
GameObject LayoutAutoEnd;
|
|
|
[SerializeField] Button AutoEndConfirmBtn;
|
|
[SerializeField] Button AutoEndConfirmBtn;
|
|
|
|
|
+ [SerializeField] Sprite ConfirmBtnBg;
|
|
|
|
|
+ [SerializeField] Color ConfirmBtnNormalColor = Color.white;
|
|
|
|
|
+ [SerializeField] Color ConfirmBtnHideColor = new Color(181f / 255f, 181f / 255f, 181f / 255f, 1f);
|
|
|
[Tooltip("没有存在校准数据时候显示")]
|
|
[Tooltip("没有存在校准数据时候显示")]
|
|
|
[SerializeField]
|
|
[SerializeField]
|
|
|
GameObject TipAutoEnd;
|
|
GameObject TipAutoEnd;
|
|
@@ -189,6 +192,11 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
RawImage CameraSecondImage; //第二个结果屏幕
|
|
RawImage CameraSecondImage; //第二个结果屏幕
|
|
|
[SerializeField] LineGenerator FirstUILineGenerator;//第一个结果屏幕线条
|
|
[SerializeField] LineGenerator FirstUILineGenerator;//第一个结果屏幕线条
|
|
|
[SerializeField] LineGenerator SecondUILineGenerator;//第二个结果屏幕线条
|
|
[SerializeField] LineGenerator SecondUILineGenerator;//第二个结果屏幕线条
|
|
|
|
|
+
|
|
|
|
|
+ [Tooltip("没有存在校准数据时候显示提示失败")]
|
|
|
|
|
+ [SerializeField]
|
|
|
|
|
+ GameObject AutoCalibrationFailedTip;
|
|
|
|
|
+
|
|
|
bool bMarkerFinish = false;
|
|
bool bMarkerFinish = false;
|
|
|
ScreenPositioningStep perStepView = ScreenPositioningStep.None;//最后一次进入LayoutSuccessful的页面
|
|
ScreenPositioningStep perStepView = ScreenPositioningStep.None;//最后一次进入LayoutSuccessful的页面
|
|
|
|
|
|
|
@@ -499,6 +507,36 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
List<Vector2> getMaskLinePositionsByDeviceType() {
|
|
List<Vector2> getMaskLinePositionsByDeviceType() {
|
|
|
return DeviceTypeHelper.DetectDeviceType() == DeviceTypeHelper.DeviceType.iPhone ? maskLine.ScreenPositions : maskLine_ipad.ScreenPositions;
|
|
return DeviceTypeHelper.DetectDeviceType() == DeviceTypeHelper.DeviceType.iPhone ? maskLine.ScreenPositions : maskLine_ipad.ScreenPositions;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 设置校准结束时候的定位按钮
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="active"></param>
|
|
|
|
|
+ public void SetAutoConfirmBtnActive(bool active)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (AutoEndConfirmBtn == null) return;
|
|
|
|
|
+
|
|
|
|
|
+ Image btnImage = AutoEndConfirmBtn.GetComponent<Image>();
|
|
|
|
|
+ if (btnImage == null) return;
|
|
|
|
|
+
|
|
|
|
|
+ // 根据 active 状态切换按钮外观
|
|
|
|
|
+ if (active)
|
|
|
|
|
+ {
|
|
|
|
|
+ btnImage.color = ConfirmBtnNormalColor;
|
|
|
|
|
+ if (ConfirmBtnBg != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ btnImage.sprite = ConfirmBtnBg;
|
|
|
|
|
+ }
|
|
|
|
|
+ AutoEndConfirmBtn.interactable = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ btnImage.color = ConfirmBtnHideColor;
|
|
|
|
|
+ btnImage.sprite = null; // 去掉背景图
|
|
|
|
|
+ AutoEndConfirmBtn.interactable = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 根据enum操作ui
|
|
/// 根据enum操作ui
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -510,6 +548,7 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
|
|
|
|
|
TipCalibrationFailedIphone.SetActive(false);
|
|
TipCalibrationFailedIphone.SetActive(false);
|
|
|
TipCalibrationFailedIpad.SetActive(false);
|
|
TipCalibrationFailedIpad.SetActive(false);
|
|
|
|
|
+ AutoCalibrationFailedTip.SetActive(false);
|
|
|
|
|
|
|
|
QuadrilateralInCamera screenAuto = ScreenLocate.Main.ScreenIdentification.QuadAuto;
|
|
QuadrilateralInCamera screenAuto = ScreenLocate.Main.ScreenIdentification.QuadAuto;
|
|
|
switch (step)
|
|
switch (step)
|
|
@@ -529,7 +568,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
if (screenAuto == null)
|
|
if (screenAuto == null)
|
|
|
{
|
|
{
|
|
|
//不存在数据,走流程2
|
|
//不存在数据,走流程2
|
|
|
- AutoEndConfirmBtn.interactable = false;
|
|
|
|
|
|
|
+ SetAutoConfirmBtnActive(false);
|
|
|
|
|
+ //AutoEndConfirmBtn.interactable = false;
|
|
|
//TipAutoEndHas.SetActive(false);
|
|
//TipAutoEndHas.SetActive(false);
|
|
|
//TipAutoEnd.SetActive(true);
|
|
//TipAutoEnd.SetActive(true);
|
|
|
if (DeviceTypeHelper.DetectDeviceType() == DeviceTypeHelper.DeviceType.iPhone) {
|
|
if (DeviceTypeHelper.DetectDeviceType() == DeviceTypeHelper.DeviceType.iPhone) {
|
|
@@ -541,7 +581,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
//存在数据,显示确认按钮
|
|
//存在数据,显示确认按钮
|
|
|
- AutoEndConfirmBtn.interactable = true;
|
|
|
|
|
|
|
+ SetAutoConfirmBtnActive(true);
|
|
|
|
|
+ //AutoEndConfirmBtn.interactable = true;
|
|
|
//TipAutoEndHas.SetActive(true);
|
|
//TipAutoEndHas.SetActive(true);
|
|
|
//TipAutoEnd.SetActive(false);
|
|
//TipAutoEnd.SetActive(false);
|
|
|
}
|
|
}
|
|
@@ -790,8 +831,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
SyncQuadUnityVectorListToMarkerPointesPos();
|
|
SyncQuadUnityVectorListToMarkerPointesPos();
|
|
|
//显示提示
|
|
//显示提示
|
|
|
pointMarker.ShowHintImageParent(true);
|
|
pointMarker.ShowHintImageParent(true);
|
|
|
- AutoEndConfirmBtn.interactable = true;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //AutoEndConfirmBtn.interactable = true;
|
|
|
|
|
+ SetAutoConfirmBtnActive(true);
|
|
|
if (curStepView == ScreenPositioningStep.Start || curStepView == ScreenPositioningStep.AutoEnd) {
|
|
if (curStepView == ScreenPositioningStep.Start || curStepView == ScreenPositioningStep.AutoEnd) {
|
|
|
//如果是开始页面进行自动定位的
|
|
//如果是开始页面进行自动定位的
|
|
|
if (curStepView != ScreenPositioningStep.AutoEnd) {
|
|
if (curStepView != ScreenPositioningStep.AutoEnd) {
|
|
@@ -808,17 +849,22 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
QuadrilateralInCamera screenSemiAuto = ScreenLocate.Main.ScreenIdentification.QuadSemiAuto;
|
|
QuadrilateralInCamera screenSemiAuto = ScreenLocate.Main.ScreenIdentification.QuadSemiAuto;
|
|
|
if (screenAuto != null)
|
|
if (screenAuto != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log("[校准流程]Successful自动识别screenAuto信息 ------------ ");
|
|
|
|
|
|
|
+ //Debug.Log("[校准流程]Successful自动识别screenAuto信息 ------------ ");
|
|
|
|
|
+ if (AutoCalibrationFailedTip != null)
|
|
|
|
|
+ AutoCalibrationFailedTip.SetActive(false);
|
|
|
|
|
+
|
|
|
CurrentUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenAuto, texSize);
|
|
CurrentUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenAuto, texSize);
|
|
|
FirstUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenAuto, texSize);
|
|
FirstUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenAuto, texSize);
|
|
|
}
|
|
}
|
|
|
- //else
|
|
|
|
|
- //{
|
|
|
|
|
- // Debug.LogError("screenAuto 不存在!");
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (AutoCalibrationFailedTip != null)
|
|
|
|
|
+ AutoCalibrationFailedTip.SetActive(true);
|
|
|
|
|
+ //Debug.LogError("screenAuto 不存在!");
|
|
|
|
|
+ }
|
|
|
if (screenSemiAuto != null)
|
|
if (screenSemiAuto != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log("[校准流程]Successful半自动识别screenSemiAuto信息 ------------ ");
|
|
|
|
|
|
|
+ //Debug.Log("[校准流程]Successful半自动识别screenSemiAuto信息 ------------ ");
|
|
|
SecondUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenSemiAuto, texSize);
|
|
SecondUILineGenerator.Points = infraredDemo.ConvertQuadToPoints(screenSemiAuto, texSize);
|
|
|
}
|
|
}
|
|
|
//else
|
|
//else
|
|
@@ -1073,7 +1119,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
if (curStepView != ScreenPositioningStep.AutoEnd) {
|
|
if (curStepView != ScreenPositioningStep.AutoEnd) {
|
|
|
SetScreenPositioningStepState(ScreenPositioningStep.AutoEnd);
|
|
SetScreenPositioningStepState(ScreenPositioningStep.AutoEnd);
|
|
|
}
|
|
}
|
|
|
- AutoEndConfirmBtn.interactable = false;
|
|
|
|
|
|
|
+ //AutoEndConfirmBtn.interactable = false;
|
|
|
|
|
+ SetAutoConfirmBtnActive(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1468,6 +1515,11 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
//选择全自动结果后进入游戏
|
|
//选择全自动结果后进入游戏
|
|
|
void OnFirstResult()
|
|
void OnFirstResult()
|
|
|
{
|
|
{
|
|
|
|
|
+ QuadrilateralInCamera screenAuto = ScreenLocate.Main.ScreenIdentification.QuadAuto;
|
|
|
|
|
+ if (screenAuto == null) {
|
|
|
|
|
+ Debug.Log("校准结果为空!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
ScreenLocate.Main.SelectScreenAfterLocate(ScreenLocate.ScreenIdentificationTag.Auto);
|
|
ScreenLocate.Main.SelectScreenAfterLocate(ScreenLocate.ScreenIdentificationTag.Auto);
|
|
|
UpdateQuadUnityVectorList();
|
|
UpdateQuadUnityVectorList();
|
|
|
onCompelete();
|
|
onCompelete();
|
|
@@ -1478,7 +1530,6 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
|
|
|
{
|
|
{
|
|
|
ScreenLocate.Main.SelectScreenAfterLocate(ScreenLocate.ScreenIdentificationTag.SemiAuto);
|
|
ScreenLocate.Main.SelectScreenAfterLocate(ScreenLocate.ScreenIdentificationTag.SemiAuto);
|
|
|
UpdateQuadUnityVectorList();
|
|
UpdateQuadUnityVectorList();
|
|
|
-
|
|
|
|
|
onCompelete();
|
|
onCompelete();
|
|
|
}
|
|
}
|
|
|
|
|
|