|
|
@@ -85,6 +85,7 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
configsInited = true;
|
|
|
|
|
|
NewUserGuiderConfig config = new NewUserGuiderConfig();
|
|
|
+ config.key = "模块开机";
|
|
|
config.hitPosType = 1;
|
|
|
config.hitPos = new Vector2(-86.4f, -70.3f);
|
|
|
config.pointerRotZ = 120;
|
|
|
@@ -92,109 +93,13 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
config.pointerPos = new Vector2(-155, -31);
|
|
|
config.frameTipPosType = 1;
|
|
|
config.frameTipPos = new Vector2(-73.5f, 106);
|
|
|
- config.frameTipText = "长按模块上的<color=#FFA500>“开机”</color>键,当绿灯闪烁时,即模块处于等待连接的状态。";
|
|
|
config.onStart = (g) => g.transform.Find("IconModule").gameObject.SetActive(true);
|
|
|
- configs.Add("模块开机", config);
|
|
|
-
|
|
|
-
|
|
|
- config = new NewUserGuiderConfig();
|
|
|
- config.hitActive = false;
|
|
|
- config.pointerActive = false;
|
|
|
- config.frameTipPivot = "ct";
|
|
|
- config.frameTipPosType = 1;
|
|
|
- config.frameTipPos = Vector2.zero;
|
|
|
- config.frameTipText = "恭喜您完成了本次新手教程,下次如果还\n要" +
|
|
|
- "<color=#FFA500>了解本教程</color>请在<color=#FFA500>游戏教程中选择新手指导</color>。";
|
|
|
- config.onStart = (g) => {
|
|
|
- g.GetMaskClickedEvent().AddListener(() => {
|
|
|
- OnEnd();
|
|
|
- });
|
|
|
-
|
|
|
- GameMode gameMode = GameMgr.ins.gameMode;
|
|
|
- if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
|
|
|
- gameMode.PauseTimeCounting(g);
|
|
|
- g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
- }
|
|
|
- };
|
|
|
- configs.Add("教程结束", config);
|
|
|
-
|
|
|
-
|
|
|
- config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "rb";
|
|
|
- config.frameTipPos = Vector2.zero;
|
|
|
- config.frameTipText = "点击<color=#FFA500>视角归位按钮,按完按键后立刻以标准射箭姿势瞄准\n靶心</color>," +
|
|
|
- "3秒后完成视角的自动归位。";
|
|
|
- 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;
|
|
|
- g.config.hitPos = btn4_img.position;
|
|
|
- g.config.pointerRotZ = 120;
|
|
|
- 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);
|
|
|
- g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
- }
|
|
|
- };
|
|
|
- config.onStart = (g) => {
|
|
|
- g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
- g.GetNewUserGuiderButton().onClick += g.OnClick_ToNext;
|
|
|
- };
|
|
|
- configs.Add("视角归位-触发", config);
|
|
|
-
|
|
|
-
|
|
|
- config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "lc";
|
|
|
- config.frameTipText = "请参考图中小人的姿势,<color=#FFA500>立即瞄准屏幕中\n的靶心</color>,3秒后完成视角的自动归位。";
|
|
|
- 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.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);
|
|
|
-
|
|
|
- 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);
|
|
|
-
|
|
|
- GameMode gameMode = GameMgr.ins.gameMode;
|
|
|
- if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
|
|
|
- gameMode.PauseTimeCounting(g);
|
|
|
- g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
- }
|
|
|
- };
|
|
|
- configs.Add("视角归位-瞄准", config);
|
|
|
-
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "连接设备";
|
|
|
config.frameTipPivot = "lb";
|
|
|
- config.frameTipText = "点击<color=#FFA500>“连接”</color>等待设备提示连接成功,此时模块处于绿灯常亮的状态。";
|
|
|
+ config.frameTipText = TextAutoLanguage2.GetTextByKey("new-user-guider_tip_" + config.key);
|
|
|
config.onPrepare = (g) => {
|
|
|
RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/Btn").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
@@ -205,66 +110,86 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.pointerPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 80f, btn);
|
|
|
g.config.frameTipPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 150f, btn);
|
|
|
};
|
|
|
- configs.Add("连接设备", config);
|
|
|
-
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "弓箭详情";
|
|
|
config.frameTipPivot = "lt";
|
|
|
- config.frameTipText = "点击<color=#FFA500>联机游戏</color>进入游戏";
|
|
|
config.onPrepare = (g) => {
|
|
|
- RectTransform btn = GameObject.Find("HomeView/RightPanel/Item (1)").GetComponent<RectTransform>();
|
|
|
+ RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/BtnShowDetail").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
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.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);
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
- configs.Add("联机游戏", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "lt";
|
|
|
- config.frameTipText = "点击<color=#FFA500>开始游戏</color>,开始对局吧!";
|
|
|
+ config.key = "设备-陀螺仪校准";
|
|
|
+ config.frameTipPivot = "rt";
|
|
|
config.onPrepare = (g) => {
|
|
|
- RectTransform btn = GameObject.Find("HomeView/RightPanel/Item").GetComponent<RectTransform>();
|
|
|
+ if (!DeviceView1.ins) {
|
|
|
+ g.customPreparePass = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ g.customPreparePass = true;
|
|
|
+
|
|
|
+ RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/GyrCalibrate") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
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"));
|
|
|
- });
|
|
|
+ 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 * 80f, g.iconPointer);
|
|
|
};
|
|
|
- configs.Add("开始游戏", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "lt";
|
|
|
- config.frameTipText = "点击<color=#FFA500>弓箭</color>,查看更多信息。";
|
|
|
+ config.key = "设备-地磁计校准";
|
|
|
+ config.frameTipPivot = "rt";
|
|
|
config.onPrepare = (g) => {
|
|
|
- RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/BtnShowDetail").GetComponent<RectTransform>();
|
|
|
+ if (!DeviceView1.ins) {
|
|
|
+ g.customPreparePass = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ g.customPreparePass = true;
|
|
|
+
|
|
|
+ RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/MagCalibrate") as RectTransform;
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ g.SetIconPointerHitOpacity(0.8f);
|
|
|
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));
|
|
|
+ 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);
|
|
|
|
|
|
- HomeViewRenderBow homeViewRenderBow = FindObjectOfType<HomeViewRenderBow>();
|
|
|
- if (homeViewRenderBow) {
|
|
|
+ DeviceView1 deviceView1 = FindObjectOfType<DeviceView1>();
|
|
|
+ if (deviceView1) {
|
|
|
g.clickedWillPlayAudioBtn = false;
|
|
|
- g.GetMaskClickedEvent().AddListener(homeViewRenderBow.OnClick_ShowDeviceView);
|
|
|
+ g.GetMaskClickedEvent().AddListener(deviceView1.OnClick_Back);
|
|
|
}
|
|
|
-
|
|
|
};
|
|
|
- configs.Add("弓箭详情", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "查看设置";
|
|
|
config.frameTipPivot = "rt";
|
|
|
- config.frameTipText = "点击查看<color=#FFA500>商城</color>";
|
|
|
config.onPrepare = (g) => {
|
|
|
- RectTransform btn = GameObject.Find("TopBarView/TopBar/IconShop").GetComponent<RectTransform>();
|
|
|
+ RectTransform btn = GameObject.Find("TopBarView/TopBar/IconSetUp").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.SetIconPointerHitOpacity(0.6f);
|
|
|
@@ -274,14 +199,14 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero)
|
|
|
+ RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
|
|
|
};
|
|
|
- configs.Add("查看商城", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "查看商城";
|
|
|
config.frameTipPivot = "rt";
|
|
|
- config.frameTipText = "点击<color=#FFA500>设置</color>了解更多";
|
|
|
config.onPrepare = (g) => {
|
|
|
- RectTransform btn = GameObject.Find("TopBarView/TopBar/IconSetUp").GetComponent<RectTransform>();
|
|
|
+ RectTransform btn = GameObject.Find("TopBarView/TopBar/IconShop").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
g.SetIconPointerHitOpacity(0.6f);
|
|
|
@@ -291,12 +216,12 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero)
|
|
|
+ RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
|
|
|
};
|
|
|
- configs.Add("查看设置", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "切换好友/排行榜";
|
|
|
config.frameTipPivot = "lt";
|
|
|
- config.frameTipText = "点击切换<color=#FFA500>好友/排行榜</color>";
|
|
|
config.onPrepare = (g) => {
|
|
|
RectTransform btn = GameObject.Find("HomeView/FriendBar/FrameBtnTop").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
@@ -307,12 +232,12 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.2f, 0.9f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.2f, 0));
|
|
|
};
|
|
|
- configs.Add("切换好友/排行榜", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "展开好友/排行榜";
|
|
|
config.frameTipPivot = "lc";
|
|
|
- config.frameTipText = "展开查看<color=#FFA500>更多详情</color>";
|
|
|
config.onPrepare = (g) => {
|
|
|
RectTransform btn = GameObject.Find("HomeView/FriendBar/FrameBtnBottom").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
@@ -323,61 +248,43 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1, 0.9f));
|
|
|
g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.5f, 0.5f));
|
|
|
};
|
|
|
- configs.Add("展开好友/排行榜", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
+
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "rt";
|
|
|
- config.frameTipText = "将安装了模块的智能弓箭<color=#FFA500>静置在一个平面</color>";
|
|
|
+ config.key = "联机游戏";
|
|
|
+ config.frameTipPivot = "lt";
|
|
|
config.onPrepare = (g) => {
|
|
|
- if (!DeviceView1.ins) {
|
|
|
- g.customPreparePass = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- g.customPreparePass = true;
|
|
|
-
|
|
|
- RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/GyrCalibrate") as RectTransform;
|
|
|
+ RectTransform btn = GameObject.Find("HomeView/RightPanel/Item (1)").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
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 * 80f, g.iconPointer);
|
|
|
+ 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);
|
|
|
};
|
|
|
- configs.Add("设备-陀螺仪校准", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
+
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
- config.frameTipPivot = "rt";
|
|
|
- config.frameTipText = "将安装了模块的智能弓箭<color=#FFA500>沿着每一个轴旋转</color>";
|
|
|
+ config.key = "开始游戏";
|
|
|
+ config.frameTipPivot = "lt";
|
|
|
config.onPrepare = (g) => {
|
|
|
- if (!DeviceView1.ins) {
|
|
|
- g.customPreparePass = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- g.customPreparePass = true;
|
|
|
-
|
|
|
- RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/MagCalibrate") as RectTransform;
|
|
|
+ RectTransform btn = GameObject.Find("HomeView/RightPanel/Item").GetComponent<RectTransform>();
|
|
|
g.hollowOutMask.SetTarget(btn);
|
|
|
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);
|
|
|
- }
|
|
|
+ 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"));
|
|
|
+ });
|
|
|
};
|
|
|
- configs.Add("设备-地磁计校准", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
+
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "开始-限时游戏";
|
|
|
config.frameTipPivot = "lt";
|
|
|
- config.frameTipText = "点击<color=#FFA500>“限时游戏”</color>选择游戏类型";
|
|
|
config.onPrepare = (g) => {
|
|
|
if (!GameStartView.ins) {
|
|
|
g.customPreparePass = false;
|
|
|
@@ -404,11 +311,12 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
- configs.Add("开始-限时游戏", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
+
|
|
|
|
|
|
config = new NewUserGuiderConfig();
|
|
|
+ config.key = "限时游戏-选择距离";
|
|
|
config.frameTipPivot = "lc";
|
|
|
- config.frameTipText = "选择距离<color=#FFA500>“10米”</color>开始游戏吧!";
|
|
|
config.onPrepare = (g) => {
|
|
|
if (g.hollowOutMask.enabled) g.hollowOutMask.enabled = false;
|
|
|
if (!TimeLimitGameDistanceSelectView.ins) {
|
|
|
@@ -431,7 +339,100 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
btn.GetComponent<Button>().onClick.Invoke();
|
|
|
});
|
|
|
};
|
|
|
- configs.Add("限时游戏-选择距离", config);
|
|
|
+ configs.Add(config.key, config);
|
|
|
+
|
|
|
+
|
|
|
+ config = new NewUserGuiderConfig();
|
|
|
+ config.key = "视角归位-触发";
|
|
|
+ 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;
|
|
|
+ g.config.hitPos = btn4_img.position;
|
|
|
+ g.config.pointerRotZ = 120;
|
|
|
+ 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);
|
|
|
+ g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().RemoveAllListeners();
|
|
|
+ g.GetNewUserGuiderButton().onClick += g.OnClick_ToNext;
|
|
|
+ };
|
|
|
+ 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);
|
|
|
+
|
|
|
+ g.hollowOutMask.isTargetRectCanThrough = false;
|
|
|
+ g.hollowOutMask.SetTarget(iconRect);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ 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();
|
|
|
+ config.key = "教程结束";
|
|
|
+ config.hitActive = false;
|
|
|
+ config.pointerActive = false;
|
|
|
+ config.frameTipPivot = "ct";
|
|
|
+ config.frameTipPosType = 1;
|
|
|
+ config.frameTipPos = Vector2.zero;
|
|
|
+ config.onStart = (g) => {
|
|
|
+ g.GetMaskClickedEvent().AddListener(() => {
|
|
|
+ OnEnd();
|
|
|
+ });
|
|
|
+
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
@@ -480,7 +481,6 @@ public class NewUserGuiderManager : MonoBehaviour
|
|
|
void ExecuteCurConfig() {
|
|
|
InitConfigs();
|
|
|
NewUserGuiderConfig config = configs[curConfigKey];
|
|
|
- config.key = curConfigKey;
|
|
|
NewUserGuider guider = Instantiate(prefab_NewUserGuider).GetComponent<NewUserGuider>();
|
|
|
guider.config = config;
|
|
|
}
|
|
|
@@ -509,7 +509,8 @@ public class NewUserGuiderConfig
|
|
|
public int frameTipPosType = 0;
|
|
|
public Vector2 frameTipPos;
|
|
|
//frameTip text
|
|
|
- public string frameTipText;
|
|
|
+ public string frameTipText = null;
|
|
|
+ public string frameTipTextKey = null;
|
|
|
public Action<NewUserGuider> onPrepare;
|
|
|
public Action<NewUserGuider> onStart;
|
|
|
}
|