PanelAnim.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. import GuideMng from "../manager/GuideMng";
  8. import { PlayerPrefs } from "../tools/MyExtends";
  9. const { ccclass, property } = cc._decorator;
  10. @ccclass
  11. export default class PanelAnim extends cc.Component {
  12. @property(cc.Integer)
  13. panelType: Number = 0;
  14. //1 五福界面 2 探索 3 钱庄 4 日常任务 5 登录豪礼 6 转盘
  15. onEnable() {
  16. this.node.scale = 0;
  17. //1
  18. cc.tween(this.node).to(0.3, { scale: 1 }, { easing: "backOut" })
  19. .call(() => {
  20. if (this.panelType == 1) {
  21. //五福引导
  22. if (GuideMng.Ins.CurGuideId == 1 && PlayerPrefs.GetInt("GGuide1", 0) != 1) {
  23. GuideMng.Ins.ResumeGuide();
  24. } else {
  25. if (GuideMng.Ins.CurGuideId == 12 && PlayerPrefs.GetInt("GGuide12", 0) != 1) {
  26. //五福合成引导
  27. GuideMng.Ins.ResumeGuide();
  28. }
  29. }
  30. } else if (this.panelType == 2) {
  31. // if (PlayerPrefs.GetInt("GGuide5", 0) != 1) {
  32. // //探索 投资引导
  33. // GuideMng.Ins.ResumeGuide();
  34. // }
  35. } else if (this.panelType == 3) {
  36. if (GuideMng.Ins.CurGuideId == 7 && PlayerPrefs.GetInt("GGuide7", 0) != 1) {
  37. //钱庄引导
  38. GuideMng.Ins.ResumeGuide();
  39. }
  40. } else if (this.panelType == 4) {
  41. // if (PlayerPrefs.GetInt("GGuide8", 0) != 1) {
  42. // //日常任务引导
  43. // GuideMng.Ins.ResumeGuide();
  44. // }
  45. } else if (this.panelType == 5) {
  46. if (GuideMng.Ins.CurGuideId == 16 && PlayerPrefs.GetInt("GGuide16", 0) != 1) {
  47. //登录豪礼引导
  48. GuideMng.Ins.ResumeGuide();
  49. }
  50. }else{
  51. }
  52. if (GuideMng.Ins.CurGuideId == 15) {
  53. if (PlayerPrefs.GetInt("GGuide15", 0) != 1) {
  54. //转盘引导
  55. GuideMng.Ins.ResumeGuide();
  56. }
  57. }
  58. })
  59. .start();
  60. //2
  61. //this.node.runAction(cc.scaleTo(0.3, 1).easing(cc.easeBackOut()));
  62. }
  63. }