| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { _decorator, Component, Node, Sprite } from 'cc';
- import { UIController, UIElement } from 'db://assets/scripts/aa';
- import { UI_Dialog } from '../UI_Dialog';
- import { rootMgr } from '../../../scene/RootMgr';
- import { FMSType } from '../../../GameContorl/fms/FMSGameInit';
- const { ccclass, property } = _decorator;
- @UIController({ bundleName: 'dialog', path: 'setting/setting' })
- export class UI_Setting extends UI_Dialog {
- @UIElement(Node)
- homeBtn: Node
- @UIElement(Node)
- rePlayBtn: Node
- @UIElement(Node)
- mb2: Node
- start() {
- this.homeBtn.on(Node.EventType.TOUCH_END, this.goHome, this)
- this.rePlayBtn.on(Node.EventType.TOUCH_END, this.rePlay, this)
- if (rootMgr.game.FMS.CurrentType == FMSType.home) {
- this.homeBtn.active = false
- this.rePlayBtn.active = false
- this.mb2.active = true
- this.mb2.parent.position = this.mb2.position.clone().multiplyScalar(-1)
- this.Root.getComponent(Sprite).spriteFrame = null
- } else {
- this.mb2.active = false
- }
- }
- goHome() {
- rootMgr.game.Change(FMSType.home)
- this.onClose()
- }
- rePlay() {
- rootMgr.game.init()
- this.onClose()
- }
- }
|