Guide.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { GuideVO } from "../../data/module/GuideData";
  2. /**
  3. * @description 新手引导
  4. * @author 邹勇
  5. */
  6. const { ccclass, property } = cc._decorator;
  7. @ccclass
  8. export default class Guide extends cc.Component {
  9. @property({ type: cc.Node, displayName: "显示区域" })
  10. node_display: cc.Node = null;
  11. @property({ type: cc.Node, displayName: "点击区域" })
  12. node_click: cc.Node = null;
  13. @property(cc.Node)
  14. node_block: cc.Node = null;
  15. private guides: GuideVO[];
  16. private crtStep: number;
  17. private crtGuide: GuideVO;
  18. onLoad() {
  19. }
  20. start(){
  21. if(gData.guideData.crtID == null){
  22. this.node.destroy();
  23. return;
  24. }
  25. this.guides = gData.guideData.getGuidesByID(gData.guideData.crtID);
  26. this.crtStep = -1;
  27. this.nextStep();
  28. }
  29. private nextStep() {
  30. this.crtStep++;
  31. this.crtGuide = this.guides[this.crtStep];
  32. this.updateGuide();
  33. }
  34. private updateGuide(){
  35. }
  36. }