123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import AudioManager from "./AudioManager";
- import LoadManager from "./LoadManager";
- import LocalData from "./LocalData";
- import { ButtonLock } from "./Template/MyComponent";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class Hall extends cc.Component {
- //最高纪录
- @property(cc.Label)
- MaxRecordLabel: cc.Label = null;
- // //金币
- // @property(cc.Label)
- // GoldLabel: cc.Label = null;
- @property(cc.Node)
- UIParentNode: cc.Node = null;
- start() {
- this.init()
- AudioManager.instance.playHallBg()
- }
- init() {
- // LocalData.getInstance().setGold(99, '+')
- // LocalData.getInstance().setMaxRecord(99, '=')
- // this.GoldLabel.string = LocalData.getInstance().getGold().toString()
- this.MaxRecordLabel.string = LocalData.getInstance().getMaxRecord().toString()
- }
- @ButtonLock(1, null)
- ClickSet() {
- cc.log('ClickSet');
- (async () => {
- const url = "res/Pop/Set"
- let Prefab = await LoadManager.instance.LoadAssets<cc.Prefab>(url);
- if (cc.isValid(Prefab)) {
- let a = cc.instantiate(Prefab);
- // a.setPosition(0,0)
- this.UIParentNode.addChild(a)
- this.scheduleOnce(() => { a.setPosition(cc.v2(0, 0)) }, 0)
- }
- })();
- }
- @ButtonLock(1, null)
- ClickFuLi() {
- cc.log('ClickFuLi');
- }
- @ButtonLock(1, null)
- ClickMeiRiJiangLi() {
- return
- cc.log('ClickMeiRiJiangLi');
- (async () => {
- const url = "res/Pop/Sign"
- let Prefab = await LoadManager.instance.LoadAssets<cc.Prefab>(url);
- if (cc.isValid(Prefab)) {
- let a = cc.instantiate(Prefab);
- this.UIParentNode.addChild(a)
- this.scheduleOnce(() => { a.setPosition(cc.v2(0, 0)) }, 0)
- }
- })();
- }
- @ButtonLock(1, null)
- ClickRank() {
- cc.log('ClickRank');
- }
- @ButtonLock(1, null)
- ClickShop() {
- cc.log('ClickShop');
- (async () => {
- const url = "res/Pop/Shop"
- let Prefab = await LoadManager.instance.LoadAssets<cc.Prefab>(url);
- if (cc.isValid(Prefab)) {
- let a = cc.instantiate(Prefab);
- this.UIParentNode.addChild(a)
- this.scheduleOnce(() => { a.setPosition(cc.v2(0, 0)) }, 0)
- }
- })();
- }
- @ButtonLock(1, null)
- ClickStart() {
- cc.log('ClickStart');
- cc.director.loadScene("Game")
- }
- @ButtonLock(1, null)
- ClickBjq() {
- cc.log('ClickGold');
- cc.director.loadScene("Editer")
- }
- }
|