NewUserGuiderManager.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. using UnityEngine.SceneManagement;
  7. using JC.Unity.UI;
  8. public class NewUserGuiderManager : MonoBehaviour
  9. {
  10. [SerializeField] GameObject prefab_NewUserGuider;
  11. public static NewUserGuiderManager ins;
  12. void Awake()
  13. {
  14. if (ins) {
  15. Destroy(gameObject);
  16. return;
  17. }
  18. ins = this;
  19. DontDestroyOnLoad(gameObject);
  20. }
  21. void OnDestroy()
  22. {
  23. if (ins == this) ins = null;
  24. if (onSceneLoaded_added) SceneManager.sceneLoaded -= onSceneLoaded;
  25. }
  26. void Start()
  27. {
  28. SceneManager.sceneLoaded += onSceneLoaded; onSceneLoaded_added = true;
  29. if (!IsUserGuideFinished()) {
  30. ExecuteCurConfig();
  31. SaveUserGuideFinished(true);
  32. }
  33. }
  34. bool onSceneLoaded_added = false;
  35. void onSceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { //初始话的场景不会触发
  36. if (scene.name == "Game" && GameMgr.gameType == 1) {
  37. switch (curConfigKey) {
  38. case "开始-限时游戏":
  39. OnClickedDestroyed(curConfigKey);
  40. break;
  41. case "限时游戏-选择距离":
  42. ExecuteCurConfig();
  43. break;
  44. }
  45. }
  46. }
  47. public void OnSkip()
  48. {
  49. curConfigKey = null;
  50. SaveUserGuideFinished(true);
  51. }
  52. public void OnEnd()
  53. {
  54. curConfigKey = null;
  55. SaveUserGuideFinished(true);
  56. }
  57. public void ReviewNewUserGuide()
  58. {
  59. int viewCount = PersistenHandler.ins.menuBackCtr.views.Count;
  60. for (int i = 0; i < viewCount; i++) {
  61. PersistenHandler.ins.menuBackCtr.OnOnceBack();
  62. }
  63. curConfigKey = "模块开机";
  64. ExecuteCurConfig();
  65. }
  66. void SaveUserGuideFinished(bool finished) {
  67. PlayerPrefs.SetInt("NewUserGuiderFinished", finished ? 1 : 0);
  68. }
  69. bool IsUserGuideFinished() {
  70. return PlayerPrefs.GetInt("NewUserGuiderFinished", 0) == 1 ? true : false;
  71. }
  72. void InitConfigs()
  73. {
  74. if (configsInited) return;
  75. configsInited = true;
  76. NewUserGuiderConfig config = new NewUserGuiderConfig();
  77. config.hitPosType = 1;
  78. config.hitPos = new Vector2(-86.4f, -70.3f);
  79. config.pointerRotZ = 120;
  80. config.pointerPosType = 1;
  81. config.pointerPos = new Vector2(-155, -31);
  82. config.frameTipPosType = 1;
  83. config.frameTipPos = new Vector2(-73.5f, 106);
  84. config.frameTipText = "长按模块上的<color=#FFA500>“开机”</color>键,当绿灯闪烁时,即模块处于等待连接的状态。";
  85. config.onStart = (g) => g.transform.Find("IconModule").gameObject.SetActive(true);
  86. configs.Add("模块开机", config);
  87. config = new NewUserGuiderConfig();
  88. config.hitActive = false;
  89. config.pointerActive = false;
  90. config.frameTipPivot = "ct";
  91. config.frameTipPosType = 1;
  92. config.frameTipPos = Vector2.zero;
  93. config.frameTipText = "恭喜您完成了本次新手教程,下次如果还\n要" +
  94. "<color=#FFA500>了解本教程</color>请在<color=#FFA500>游戏教程中选择新手指导</color>。";
  95. config.onStart = (g) => {
  96. g.GetMaskClickedEvent().AddListener(() => {
  97. OnEnd();
  98. });
  99. GameMode gameMode = GameMgr.ins.gameMode;
  100. if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
  101. gameMode.PauseTimeCounting(g);
  102. g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
  103. }
  104. };
  105. configs.Add("教程结束", config);
  106. config = new NewUserGuiderConfig();
  107. config.frameTipPivot = "rb";
  108. config.frameTipPos = Vector2.zero;
  109. config.frameTipText = "点击<color=#FFA500>视角归位按钮,按完按键后立刻以标准射箭姿势瞄准\n靶心</color>," +
  110. "3秒后完成视角的自动归位。";
  111. config.onPrepare = (g) => {
  112. if (!GameAssistUI.ins) {
  113. g.customPreparePass = false;
  114. return;
  115. }
  116. g.customPreparePass = true;
  117. g.hollowOutMask.isTargetRectCanThrough = false;
  118. RectTransform btn4 = GameAssistUI.ins.transform.Find("Button4") as RectTransform;
  119. g.hollowOutMask.SetTarget(btn4);
  120. RectTransform btn4_img = btn4.Find("Image") as RectTransform;
  121. g.config.hitPos = btn4_img.position;
  122. g.config.pointerRotZ = 120;
  123. g.config.pointerPos = btn4_img.position + RectTransformUtils.CanvasV3ToScreenV3(new Vector3(-60, 60), btn4);
  124. g.config.frameTipPos = btn4_img.position + RectTransformUtils.CanvasV3ToScreenV3(new Vector3(-120, 120), btn4);
  125. // g.clickedWillPlayAudioBtn = false;
  126. // g.GetMaskClickedEvent().AddListener(() => {
  127. // btn4.GetComponent<Button>().onClick.Invoke();
  128. // });
  129. GameMode gameMode = GameMgr.ins.gameMode;
  130. if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
  131. gameMode.PauseTimeCounting(g);
  132. g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
  133. }
  134. };
  135. configs.Add("视角归位-触发", config);
  136. config = new NewUserGuiderConfig();
  137. config.frameTipPivot = "lc";
  138. config.frameTipText = "请参考图中小人的姿势,<color=#FFA500>立即瞄准屏幕中\n的靶心</color>,3秒后完成视角的自动归位。";
  139. config.onPrepare = (g) => {
  140. float rectSideLen = RectTransformUtils.ScreenV3ToCanvasV3(Vector3.right * Screen.height * 100 / 720f, g.GetComponent<RectTransform>()).x;
  141. Vector2 rectSize = new Vector2(rectSideLen, rectSideLen);
  142. RectTransform iconRect = g.transform.Find("IconRect") as RectTransform;
  143. iconRect.sizeDelta = rectSize;
  144. iconRect.gameObject.SetActive(true);
  145. g.hollowOutMask.isTargetRectCanThrough = false;
  146. g.hollowOutMask.SetTarget(iconRect);
  147. g.config.hitPosType = 1;
  148. g.config.hitPos = Vector2.zero;
  149. g.config.pointerPosType = 1;
  150. g.config.pointerRotZ = 120;
  151. g.config.pointerPos = new Vector2(-rectSideLen / 2 * 1.2f, rectSideLen / 2 * 1.1f);
  152. RectTransform iconHumanShoot = g.transform.Find("IconHumanShoot") as RectTransform;
  153. iconHumanShoot.anchoredPosition = g.config.pointerPos;
  154. iconHumanShoot.gameObject.SetActive(true);
  155. g.config.frameTipPosType = 1;
  156. g.config.frameTipPos = new Vector2(rectSideLen / 2 * 1.3f, 0);
  157. GameMode gameMode = GameMgr.ins.gameMode;
  158. if (gameMode.GetType().Equals(typeof(TimeLimitGameMode))) {
  159. gameMode.PauseTimeCounting(g);
  160. g.action_OnDestroy += () => gameMode.ResumeTimeCounting(g);
  161. }
  162. };
  163. configs.Add("视角归位-瞄准", config);
  164. config = new NewUserGuiderConfig();
  165. config.frameTipPivot = "lb";
  166. config.frameTipText = "点击<color=#FFA500>“连接”</color>等待设备提示连接成功,此时模块处于绿灯常亮的状态。";
  167. config.onPrepare = (g) => {
  168. RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/Btn").GetComponent<RectTransform>();
  169. g.hollowOutMask.SetTarget(btn);
  170. g.hollowOutMask.isTargetRectCanThrough = false;
  171. g.SetIconPointerHitOpacity(0.5f);
  172. g.config.hitPos = btn.position;
  173. g.config.pointerPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 80f, btn);
  174. g.config.frameTipPos = btn.position + RectTransformUtils.CanvasV3ToScreenV3(Vector3.up * 150f, btn);
  175. };
  176. configs.Add("连接设备", config);
  177. config = new NewUserGuiderConfig();
  178. config.frameTipPivot = "lt";
  179. config.frameTipText = "点击<color=#FFA500>联机游戏</color>进入游戏";
  180. config.onPrepare = (g) => {
  181. RectTransform btn = GameObject.Find("HomeView/RightPanel/Item (1)").GetComponent<RectTransform>();
  182. g.hollowOutMask.SetTarget(btn);
  183. g.hollowOutMask.isTargetRectCanThrough = false;
  184. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.5f, 0.6f));
  185. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.9f));
  186. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero);
  187. };
  188. configs.Add("联机游戏", config);
  189. config = new NewUserGuiderConfig();
  190. config.frameTipPivot = "lt";
  191. config.frameTipText = "点击<color=#FFA500>开始游戏</color>,开始对局吧!";
  192. config.onPrepare = (g) => {
  193. RectTransform btn = GameObject.Find("HomeView/RightPanel/Item").GetComponent<RectTransform>();
  194. g.hollowOutMask.SetTarget(btn);
  195. g.hollowOutMask.isTargetRectCanThrough = false;
  196. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.5f, 0.6f));
  197. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.9f));
  198. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero);
  199. g.GetMaskClickedEvent().AddListener(() => {
  200. GameObject.Instantiate(SceneResMgr.ins.GetPrefab("GameStartView"));
  201. });
  202. };
  203. configs.Add("开始游戏", config);
  204. config = new NewUserGuiderConfig();
  205. config.frameTipPivot = "lt";
  206. config.frameTipText = "点击<color=#FFA500>弓箭</color>,查看更多信息。";
  207. config.onPrepare = (g) => {
  208. RectTransform btn = GameObject.Find("HomeView/HomeViewRenderBow/BtnShowDetail").GetComponent<RectTransform>();
  209. g.hollowOutMask.SetTarget(btn);
  210. g.hollowOutMask.isTargetRectCanThrough = false;
  211. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  212. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.7f));
  213. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.8f, 0.5f));
  214. HomeViewRenderBow homeViewRenderBow = FindObjectOfType<HomeViewRenderBow>();
  215. if (homeViewRenderBow) {
  216. g.clickedWillPlayAudioBtn = false;
  217. g.GetMaskClickedEvent().AddListener(homeViewRenderBow.OnClick_ShowDeviceView);
  218. }
  219. };
  220. configs.Add("弓箭详情", config);
  221. config = new NewUserGuiderConfig();
  222. config.frameTipPivot = "rt";
  223. config.frameTipText = "点击查看<color=#FFA500>商城</color>";
  224. config.onPrepare = (g) => {
  225. RectTransform btn = GameObject.Find("TopBarView/TopBar/IconShop").GetComponent<RectTransform>();
  226. g.hollowOutMask.SetTarget(btn);
  227. g.hollowOutMask.isTargetRectCanThrough = false;
  228. g.SetIconPointerHitOpacity(0.6f);
  229. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  230. g.config.pointerRotZ = 180;
  231. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * -0.1f);
  232. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero)
  233. + RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
  234. };
  235. configs.Add("查看商城", config);
  236. config = new NewUserGuiderConfig();
  237. config.frameTipPivot = "rt";
  238. config.frameTipText = "点击<color=#FFA500>设置</color>了解更多";
  239. config.onPrepare = (g) => {
  240. RectTransform btn = GameObject.Find("TopBarView/TopBar/IconSetUp").GetComponent<RectTransform>();
  241. g.hollowOutMask.SetTarget(btn);
  242. g.hollowOutMask.isTargetRectCanThrough = false;
  243. g.SetIconPointerHitOpacity(0.6f);
  244. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  245. g.config.pointerRotZ = 180;
  246. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * -0.1f);
  247. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.zero)
  248. + RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
  249. };
  250. configs.Add("查看设置", config);
  251. config = new NewUserGuiderConfig();
  252. config.frameTipPivot = "lt";
  253. config.frameTipText = "点击切换<color=#FFA500>好友/排行榜</color>";
  254. config.onPrepare = (g) => {
  255. RectTransform btn = GameObject.Find("HomeView/FriendBar/FrameBtnTop").GetComponent<RectTransform>();
  256. g.hollowOutMask.SetTarget(btn);
  257. g.hollowOutMask.isTargetRectCanThrough = false;
  258. g.SetIconPointerHitOpacity(0.6f);
  259. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  260. g.config.pointerRotZ = -30;
  261. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.2f, 0.9f));
  262. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.2f, 0));
  263. };
  264. configs.Add("切换好友/排行榜", config);
  265. config = new NewUserGuiderConfig();
  266. config.frameTipPivot = "lc";
  267. config.frameTipText = "展开查看<color=#FFA500>更多详情</color>";
  268. config.onPrepare = (g) => {
  269. RectTransform btn = GameObject.Find("HomeView/FriendBar/FrameBtnBottom").GetComponent<RectTransform>();
  270. g.hollowOutMask.SetTarget(btn);
  271. g.hollowOutMask.isTargetRectCanThrough = false;
  272. g.SetIconPointerHitOpacity(0.8f);
  273. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  274. g.config.pointerRotZ = -30;
  275. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1, 0.9f));
  276. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.5f, 0.5f));
  277. };
  278. configs.Add("展开好友/排行榜", config);
  279. config = new NewUserGuiderConfig();
  280. config.frameTipPivot = "rt";
  281. config.frameTipText = "将安装了模块的智能弓箭<color=#FFA500>静置在一个平面</color>";
  282. config.onPrepare = (g) => {
  283. if (!DeviceView1.ins) {
  284. g.customPreparePass = false;
  285. return;
  286. }
  287. g.customPreparePass = true;
  288. RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/GyrCalibrate") as RectTransform;
  289. g.hollowOutMask.SetTarget(btn);
  290. g.hollowOutMask.isTargetRectCanThrough = false;
  291. g.SetIconPointerHitOpacity(0.8f);
  292. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  293. g.config.pointerRotZ = 180;
  294. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(-0.1f, 0.2f));
  295. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.3f, 0))
  296. + RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 80f, g.iconPointer);
  297. };
  298. configs.Add("设备-陀螺仪校准", config);
  299. config = new NewUserGuiderConfig();
  300. config.frameTipPivot = "rt";
  301. config.frameTipText = "将安装了模块的智能弓箭<color=#FFA500>沿着每一个轴旋转</color>";
  302. config.onPrepare = (g) => {
  303. if (!DeviceView1.ins) {
  304. g.customPreparePass = false;
  305. return;
  306. }
  307. g.customPreparePass = true;
  308. RectTransform btn = DeviceView1.ins.transform.Find("ItemInfo/BowOptions/MagCalibrate") as RectTransform;
  309. g.hollowOutMask.SetTarget(btn);
  310. g.hollowOutMask.isTargetRectCanThrough = false;
  311. g.SetIconPointerHitOpacity(0.8f);
  312. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  313. g.config.pointerRotZ = 180;
  314. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(-0.1f, 0.2f));
  315. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.3f, 0))
  316. + RectTransformUtils.CanvasV3ToScreenV3(Vector3.down * 60f, g.iconPointer);
  317. DeviceView1 deviceView1 = FindObjectOfType<DeviceView1>();
  318. if (deviceView1) {
  319. g.clickedWillPlayAudioBtn = false;
  320. g.GetMaskClickedEvent().AddListener(deviceView1.OnClick_Back);
  321. }
  322. };
  323. configs.Add("设备-地磁计校准", config);
  324. config = new NewUserGuiderConfig();
  325. config.frameTipPivot = "lt";
  326. config.frameTipText = "点击<color=#FFA500>“限时游戏”</color>选择游戏类型";
  327. config.onPrepare = (g) => {
  328. if (!GameStartView.ins) {
  329. g.customPreparePass = false;
  330. return;
  331. }
  332. g.customPreparePass = true;
  333. RectTransform btn = GameStartView.ins.transform.Find("EntryList/Item (1)") as RectTransform;
  334. g.hollowOutMask.SetTarget(btn);
  335. g.hollowOutMask.isTargetRectCanThrough = false;
  336. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  337. g.config.pointerRotZ = 180;
  338. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.2f, 0.3f));
  339. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.4f, 0.15f));
  340. };
  341. config.onStart = (g) => {
  342. GameStartView gameStartView = FindObjectOfType<GameStartView>();
  343. if (gameStartView) {
  344. string ck = g.config.key;
  345. g.GetMaskClickedEvent().RemoveAllListeners();
  346. g.GetMaskClickedEvent().AddListener(() => {
  347. gameStartView.GoTo("限时");
  348. //后续在NewUserGuiderManager.onSceneLoaded触发
  349. });
  350. }
  351. };
  352. configs.Add("开始-限时游戏", config);
  353. config = new NewUserGuiderConfig();
  354. config.frameTipPivot = "lc";
  355. config.frameTipText = "选择距离<color=#FFA500>“10米”</color>开始游戏吧!";
  356. config.onPrepare = (g) => {
  357. if (g.hollowOutMask.enabled) g.hollowOutMask.enabled = false;
  358. if (!TimeLimitGameDistanceSelectView.ins) {
  359. g.customPreparePass = false;
  360. return;
  361. }
  362. g.customPreparePass = true;
  363. g.hollowOutMask.enabled = true;
  364. RectTransform btn = TimeLimitGameDistanceSelectView.ins.transform.Find("Layout/Item") as RectTransform;
  365. g.hollowOutMask.SetTarget(btn);
  366. g.hollowOutMask.isTargetRectCanThrough = false;
  367. g.config.hitPos = RectTransformUtils.GetPositionByPivot(btn, Vector2.one * 0.5f);
  368. g.config.pointerRotZ = -30;
  369. g.config.pointerPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(0.85f, 0.5f));
  370. g.config.frameTipPos = RectTransformUtils.GetPositionByPivot(btn, new Vector2(1.15f, 0.4f));
  371. g.clickedWillPlayAudioBtn = false;
  372. g.GetMaskClickedEvent().AddListener(() => {
  373. btn.GetComponent<Button>().onClick.Invoke();
  374. });
  375. };
  376. configs.Add("限时游戏-选择距离", config);
  377. }
  378. #if UNITY_EDITOR
  379. bool warn_test = false;
  380. void Update() {
  381. if (!warn_test) {
  382. warn_test = true;
  383. Debug.LogWarning("F3-重置设备校准引导,规则引导");
  384. Debug.LogWarning("F4-重置新手引导记录");
  385. }
  386. if (Input.GetKeyDown(KeyCode.F3)) {
  387. Debug.Log("重置设备校准引导,规则引导");
  388. AimHandler.ins.MagCalibrater = new o0._9Axis.MagnetometerAutoCalibrater();
  389. UserSettings.ins.deviceCalibrateGuideFinish = false;
  390. UserSettings.ins.gameRuleGuideFinish = new HashSet<int>();
  391. }
  392. if (Input.GetKeyDown(KeyCode.F4)) {
  393. Debug.Log("重置新手引导记录");
  394. SaveUserGuideFinished(false);
  395. }
  396. }
  397. #endif
  398. private Dictionary<string, NewUserGuiderConfig> configs = new Dictionary<string, NewUserGuiderConfig>();
  399. private bool configsInited = false;
  400. [SerializeField] public string curConfigKey = "模块开机";
  401. private List<string> configKeyList = new List<string>(new string[]{
  402. "模块开机",
  403. "连接设备",
  404. "弓箭详情",
  405. "设备-陀螺仪校准",
  406. "设备-地磁计校准",
  407. "查看设置",
  408. "查看商城",
  409. "切换好友/排行榜",
  410. "展开好友/排行榜",
  411. "联机游戏",
  412. "开始游戏",
  413. "开始-限时游戏",
  414. "限时游戏-选择距离",
  415. "视角归位-触发",
  416. "视角归位-瞄准",
  417. "教程结束",
  418. });
  419. void ExecuteCurConfig() {
  420. InitConfigs();
  421. NewUserGuiderConfig config = configs[curConfigKey];
  422. config.key = curConfigKey;
  423. NewUserGuider guider = Instantiate(prefab_NewUserGuider).GetComponent<NewUserGuider>();
  424. guider.config = config;
  425. }
  426. public void OnClickedDestroyed(string configKey) {
  427. int nextIndex = configKeyList.IndexOf(configKey) + 1;
  428. if (nextIndex >= configKeyList.Count) return;
  429. curConfigKey = configKeyList[nextIndex];
  430. ExecuteCurConfig();
  431. }
  432. }
  433. public class NewUserGuiderConfig
  434. {
  435. public string key;
  436. //0:position,1:anchoredPosition
  437. public int hitPosType = 0;
  438. public Vector2 hitPos;
  439. public bool hitActive = true;
  440. //icon pointer rotation z
  441. public float pointerRotZ;
  442. public int pointerPosType = 0;
  443. public Vector2 pointerPos;
  444. public bool pointerActive = true;
  445. //frameTip-Pivot l:left,r:right,t:top,b:bottom,ct:center
  446. public string frameTipPivot = "lt";
  447. public int frameTipPosType = 0;
  448. public Vector2 frameTipPos;
  449. //frameTip text
  450. public string frameTipText;
  451. public Action<NewUserGuider> onPrepare;
  452. public Action<NewUserGuider> onStart;
  453. }