guidePanel.ts 880 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { App } from "../Manager/App";
  2. const {ccclass, property} = cc._decorator;
  3. @ccclass
  4. export default class guidePanel extends cc.Component {
  5. private static _instance: guidePanel = null;
  6. // LIFE-CYCLE CALLBACKS:
  7. public static getInstance(): any {
  8. if (this._instance == null) {
  9. this._instance = new guidePanel();
  10. }
  11. return this._instance;
  12. }
  13. onLoad () {
  14. guidePanel._instance = this;
  15. }
  16. start () {
  17. }
  18. public showCurGuide(){
  19. for (let i = 0; i < 5; i++) {
  20. this.node.children[i].active = false;
  21. }
  22. this.node.children[App.DataManager.guideStep].active = true;
  23. }
  24. public hideGuideStep(){
  25. for (let i = 0; i < 5; i++) {
  26. this.node.children[i].active = false;
  27. }
  28. }
  29. // update (dt) {}
  30. }