|
|
@@ -87,16 +87,22 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
NewUserGuiderConfig config = new NewUserGuiderConfig();
|
|
|
config.key = "模块开机";
|
|
|
config.hitPosType = 1;
|
|
|
- config.hitPos = new Vector2(-86.4f, -70.3f);
|
|
|
+ config.hitPos = new Vector2(-138.9f, -56.1f);
|
|
|
config.pointerRotZ = 120;
|
|
|
config.pointerPosType = 1;
|
|
|
- config.pointerPos = new Vector2(-155, -31);
|
|
|
- config.frameTipPivot = "lb";
|
|
|
+ config.pointerPos = new Vector2(-205, 4);
|
|
|
+ config.frameTipPivot = "lc";
|
|
|
config.frameTipPosType = 1;
|
|
|
- config.frameTipPos = new Vector2(-73.5f, 14);
|
|
|
- config.onStart = (g) => g.transform.Find("IconModule").gameObject.SetActive(true);
|
|
|
+ config.frameTipPos = new Vector2(0, 0);
|
|
|
+ config.onStart = (g) => {
|
|
|
+ RectTransform iconModule = g.transform.Find("IconModule") as RectTransform;
|
|
|
+ iconModule.anchoredPosition = new Vector2(-146, -39);
|
|
|
+ iconModule.gameObject.SetActive(true);
|
|
|
+ g.SetIconPointerHitOpacity(0.2f);
|
|
|
+ };
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
+
|
|
|
config = new NewUserGuiderConfig();
|
|
|
config.key = "连接设备";
|
|
|
config.frameTipPivot = "lb";
|
|
|
@@ -104,15 +110,24 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
config.onPrepare = (g) => {
|
|
|
RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/Btn").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
|
|
|
g.SetIconPointerHitOpacity(0.5f);
|
|
|
g.config.hitPos = btn.position;
|
|
|
g.config.pointerPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 80f, btn);
|
|
|
g.config.frameTipPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 150f, btn);
|
|
|
};
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ g.GetMaskClickedEvent().AddListener(() => {
|
|
|
+ if (BluetoothAim.ins.status == BluetoothStatusEnum.ConnectSuccess) {
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
+
|
|
|
config = new NewUserGuiderConfig();
|
|
|
config.key = "弓箭详情";
|
|
|
config.frameTipPivot = "lt";
|
|
|
@@ -123,14 +138,19 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.7f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.5f));
|
|
|
-
|
|
|
- HomeViewRenderBow homeViewRenderBow = FindObjectOfType<HomeViewRenderBow>();
|
|
|
- if (homeViewRenderBow) {
|
|
|
- g.clickedWillPlayAudioBtn = false;
|
|
|
- g.GetMaskClickedEvent().AddListener(homeViewRenderBow.OnClick_ShowDeviceView);
|
|
|
- }
|
|
|
-
|
|
|
};
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ g.GetNewUserGuiderButton().onClick += () => {
|
|
|
+ HomeViewRenderBow homeViewRenderBow = FindObjectOfType<HomeViewRenderBow>();
|
|
|
+ if (homeViewRenderBow) {
|
|
|
+ homeViewRenderBow.OnClick_ShowDeviceView();
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
@@ -146,7 +166,7 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
|
|
|
RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/GyrCalibrate") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.SetIconPointerHitOpacity(0.8f);
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
|
|
|
g.config.pointerRotZ = 180;
|
|
|
@@ -154,6 +174,18 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.3f, 0))
|
|
|
+ RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
|
|
|
};
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ Action onclickTarget = () => {
|
|
|
+ g.gameObject.SetActive(false);
|
|
|
+ DeviceCalibrateView.ins.action_OnDestroy += () => {
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ };
|
|
|
+ };
|
|
|
+ DeviceView1.ins.action_OnClickGyr += onclickTarget;
|
|
|
+ g.action_OnDestroy += () => DeviceView1.ins.action_OnClickGyr -= onclickTarget;
|
|
|
+ };
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
@@ -169,19 +201,29 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
|
|
|
RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/MagCalibrate") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.SetIconPointerHitOpacity(0.8f);
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
|
|
|
g.config.pointerRotZ = 180;
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(-0.1f, 0.2f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.3f, 0))
|
|
|
+ RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 60f, g.iconPointer);
|
|
|
-
|
|
|
- DeviceView1 deviceView1 = FindObjectOfType<DeviceView1>();
|
|
|
- if (deviceView1) {
|
|
|
- g.clickedWillPlayAudioBtn = false;
|
|
|
- g.GetMaskClickedEvent().AddListener(deviceView1.OnClick_Back);
|
|
|
- }
|
|
|
+ };
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ Action onclickTarget = () => {
|
|
|
+ g.gameObject.SetActive(false);
|
|
|
+ DeviceCalibrateView.ins.action_OnDestroy += () => {
|
|
|
+ FindObjectOfType<DeviceView1>()?.OnClick_Back();
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ };
|
|
|
+ };
|
|
|
+ DeviceView1.ins.action_OnClickMag += onclickTarget;
|
|
|
+ g.action_OnDestroy += () => {
|
|
|
+ if (!DeviceView1.ins) return;
|
|
|
+ DeviceView1.ins.action_OnClickMag -= onclickTarget;
|
|
|
+ };
|
|
|
};
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
@@ -272,13 +314,19 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
config.onPrepare = (g) => {
|
|
|
RectTransform btn = GameObject.Find("HomeView/RightPanel/Item").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.5f, 0.6f));
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.9f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero);
|
|
|
- g.GetMaskClickedEvent().AddListener(() => {
|
|
|
- GameObject.Instantiate(SceneResMgr.ins.GetPrefab("GameStartView"));
|
|
|
- });
|
|
|
+ };
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ Action onClickTarget = () => {
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ };
|
|
|
+ HomeView.ins.action_OnClickStartGame += onClickTarget;
|
|
|
+ g.action_OnDestroy += () => HomeView.ins.action_OnClickStartGame -= onClickTarget;
|
|
|
};
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
@@ -295,22 +343,14 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
|
|
|
RectTransform btn = GameStartView.ins.transform.Find("EntryList/Item (1)") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
|
|
|
g.config.pointerRotZ = 180;
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.2f, 0.3f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.4f, 0.15f));
|
|
|
};
|
|
|
config.onStart = (g) => {
|
|
|
- GameStartView gameStartView = FindObjectOfType<GameStartView>();
|
|
|
- if (gameStartView) {
|
|
|
- string ck = g.config.key;
|
|
|
- g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
- g.GetMaskClickedEvent().AddListener(() => {
|
|
|
- gameStartView.GoTo("限时");
|
|
|
- //后续在NewUserGuiderManager.onSceneLoaded触发
|
|
|
- });
|
|
|
- }
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
};
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
@@ -329,16 +369,23 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
|
|
|
RectTransform btn = TimeLimitGameDistanceSelectView.ins.transform.Find("Layout/Item") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
|
|
|
g.config.pointerRotZ = -30;
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.85f, 0.5f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.15f, 0.4f));
|
|
|
-
|
|
|
- g.clickedWillPlayAudioBtn = false;
|
|
|
- g.GetMaskClickedEvent().AddListener(() => {
|
|
|
- btn.GetComponent<Button>().onClick.Invoke();
|
|
|
- });
|
|
|
+ };
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ Action onClickTarget = () => {
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ };
|
|
|
+ TimeLimitGameDistanceSelectView.ins.action_OnClickSelectDistance += onClickTarget;
|
|
|
+ g.action_OnDestroy += () => {
|
|
|
+ if (!TimeLimitGameDistanceSelectView.ins) return;
|
|
|
+ TimeLimitGameDistanceSelectView.ins.action_OnClickSelectDistance -= onClickTarget;
|
|
|
+ };
|
|
|
};
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
@@ -348,12 +395,6 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
config.frameTipPivot = "rb";
|
|
|
config.frameTipPos = Vector2.zero;
|
|
|
config.onPrepare = (g) => {
|
|
|
- if (!GameAssistUI.ins) {
|
|
|
- g.customPreparePass = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- g.customPreparePass = true;
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
RectTransform btn4 = GameAssistUI.ins.transform.Find("Button4") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn4);
|
|
|
RectTransform btn4_img = btn4.Find("Image") as RectTransform;
|
|
|
@@ -362,10 +403,6 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.pointerPos = btn4_img.position + RectTransformUtils.CanvasV3ToScreenV3(new Vector3(-60, 60), btn4);
|
|
|
g.config.frameTipPos = btn4_img.position + RectTransformUtils.CanvasV3ToScreenV3(new Vector3(-120, 120), btn4);
|
|
|
|
|
|
- // g.clickedWillPlayAudioBtn = false;
|
|
|
- // g.GetMaskClickedEvent().AddListener(() => {
|
|
|
- // btn4.GetComponent<Button>().onClick.Invoke();
|
|
|
- // });
|
|
|
GameMode gameMode = GameMgr.ins.gameMode;
|
|
|
if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
|
|
|
gameMode.PauseTimeCounting(g);
|
|
|
@@ -374,45 +411,56 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
};
|
|
|
config.onStart = (g) => {
|
|
|
g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
- g.GetNewUserGuiderButton().onClick += g.OnClick_ToNext;
|
|
|
+ Action onClickTarget = () => {
|
|
|
+ g.gameObject.SetActive(false);
|
|
|
+ AutoResetView.ins.action_OnDestroy += () => {
|
|
|
+ DoTweenUtil.CallDelay(1, () => {
|
|
|
+ if (!g) return;
|
|
|
+ g.clickedWillPlayAudioBtn = false;
|
|
|
+ g.OnClick_ToNext();
|
|
|
+ });
|
|
|
+ };
|
|
|
+ };
|
|
|
+ GameAssistUI.ins.action_OnClickBtnIdentity += onClickTarget;
|
|
|
+ g.action_OnDestroy += () => GameAssistUI.ins.action_OnClickBtnIdentity -= onClickTarget;
|
|
|
};
|
|
|
configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
- config = new NewUserGuiderConfig();
|
|
|
- config.key = "视角归位-瞄准";
|
|
|
- config.frameTipPivot = "lc";
|
|
|
- config.onPrepare = (g) => {
|
|
|
- float rectSideLen = RectTransformUtils.ScreenV3ToCanvasV3(Vector3.right * Screen.height * 100 / 720f, g.GetComponent<RectTransform>()).x;
|
|
|
- Vector2 rectSize = new Vector2(rectSideLen, rectSideLen);
|
|
|
- RectTransform iconRect = g.transform.Find("IconRect") as RectTransform;
|
|
|
- iconRect.sizeDelta = rectSize;
|
|
|
- iconRect.gameObject.SetActive(true);
|
|
|
+ // config = new NewUserGuiderConfig();
|
|
|
+ // config.key = "视角归位-瞄准";
|
|
|
+ // config.frameTipPivot = "lc";
|
|
|
+ // config.onPrepare = (g) => {
|
|
|
+ // float rectSideLen = RectTransformUtils.ScreenV3ToCanvasV3(Vector3.right * Screen.height * 100 / 720f, g.GetComponent<RectTransform>()).x;
|
|
|
+ // Vector2 rectSize = new Vector2(rectSideLen, rectSideLen);
|
|
|
+ // RectTransform iconRect = g.transform.Find("IconRect") as RectTransform;
|
|
|
+ // iconRect.sizeDelta = rectSize;
|
|
|
+ // iconRect.gameObject.SetActive(true);
|
|
|
|
|
|
- g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
- g.hollowOutMask.SetTarget(iconRect);
|
|
|
+ // g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ // g.hollowOutMask.SetTarget(iconRect);
|
|
|
|
|
|
- g.config.hitPosType = 1;
|
|
|
- g.config.hitPos = Vector2.zero;
|
|
|
+ // g.config.hitPosType = 1;
|
|
|
+ // g.config.hitPos = Vector2.zero;
|
|
|
|
|
|
- g.config.pointerPosType = 1;
|
|
|
- g.config.pointerRotZ = 120;
|
|
|
- g.config.pointerPos = new Vector2(-rectSideLen / 2 * 1.2f, rectSideLen / 2 * 1.1f);
|
|
|
+ // g.config.pointerPosType = 1;
|
|
|
+ // g.config.pointerRotZ = 120;
|
|
|
+ // g.config.pointerPos = new Vector2(-rectSideLen / 2 * 1.2f, rectSideLen / 2 * 1.1f);
|
|
|
|
|
|
- RectTransform iconHumanShoot = g.transform.Find("IconHumanShoot") as RectTransform;
|
|
|
- iconHumanShoot.anchoredPosition = g.config.pointerPos;
|
|
|
- iconHumanShoot.gameObject.SetActive(true);
|
|
|
+ // RectTransform iconHumanShoot = g.transform.Find("IconHumanShoot") as RectTransform;
|
|
|
+ // iconHumanShoot.anchoredPosition = g.config.pointerPos;
|
|
|
+ // iconHumanShoot.gameObject.SetActive(true);
|
|
|
|
|
|
- g.config.frameTipPosType = 1;
|
|
|
- g.config.frameTipPos = new Vector2(rectSideLen / 2 * 1.3f, 0);
|
|
|
+ // g.config.frameTipPosType = 1;
|
|
|
+ // g.config.frameTipPos = new Vector2(rectSideLen / 2 * 1.3f, 0);
|
|
|
|
|
|
- GameMode gameMode = GameMgr.ins.gameMode;
|
|
|
- if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
|
|
|
- gameMode.PauseTimeCounting(g);
|
|
|
- g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
- }
|
|
|
- };
|
|
|
- configs.Add(config.key, config);
|
|
|
+ // GameMode gameMode = GameMgr.ins.gameMode;
|
|
|
+ // if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
|
|
|
+ // gameMode.PauseTimeCounting(g);
|
|
|
+ // g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
@@ -443,6 +491,7 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
warn_test = true;
|
|
|
Debug.LogWarning("F3-重置设备校准引导,规则引导");
|
|
|
Debug.LogWarning("F4-重置新手引导记录");
|
|
|
+ Debug.LogWarning("F5-新手引导强行下一步");
|
|
|
}
|
|
|
if (Input.GetKeyDown(KeyCode.F3)) {
|
|
|
Debug.Log("重置设备校准引导,规则引导");
|
|
|
@@ -454,6 +503,10 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
Debug.Log("重置新手引导记录");
|
|
|
SaveUserGuideFinished(false);
|
|
|
}
|
|
|
+ if (Input.GetKeyDown(KeyCode.F5)) {
|
|
|
+ Debug.Log("新手引导强行下一步");
|
|
|
+ FindObjectOfType<NewUserGuider>()?.OnClick_ToNext();
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
@@ -475,7 +528,7 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
"开始-限时游戏",
|
|
|
"限时游戏-选择距离",
|
|
|
"视角归位-触发",
|
|
|
- "视角归位-瞄准",
|
|
|
+ // "视角归位-瞄准",
|
|
|
"教程结束",
|
|
|
});
|
|
|
|