baowen 16 小时之前
父节点
当前提交
efbb5d29e6

+ 1 - 2
assets/editor/script/LevelContainer.ts

@@ -323,7 +323,7 @@ export class LevelContainer extends Component {
         }
     }
 
-        //获取上一关的
+    //获取上一关的
     lastLevel() {
         SuperFind.lastLevel()
         this.updateLevel()
@@ -340,6 +340,5 @@ export class LevelContainer extends Component {
         this.clearItems();
         this.swtichEditMode(false);
         this.genLvlContent(SuperFind.superFindData.imgPath, Skin.getSelectSkinPath(), Difficulty.difficutyData.difficutyCount, this._itemScales);
-        console.log("邻居关卡的图片路径",SuperFind.superFindData.imgPath,"难度数量",Difficulty.difficutyData.difficutyCount,"物品缩放",this._itemScales)
     }
 }

+ 23 - 0
assets/editor/script/SuperFindPanel.ts

@@ -28,19 +28,24 @@ export class SuperFindPanel extends Component {
     tipLabel2: Label = null
     @property(Label)
     showOrHideScaleLabel: Label = null
+    @property(Label)
+    countDownLabel: Label = null
 
     @property(Node)
     bottom: Node = null
 
     _showScale:boolean = false
+    _gameTime:number = 600
 
     protected start(): void {
         this.init()
         EventMgr.ins.addEventListener("refreshLevelInfo",this.refreshInfo,this)
+        this.restartCountDown()
     }
     init()
     {
         this.refreshInfo()
+        this.countDownLabel.string = this._gameTime.toString()+"秒"
         let bgPath = SuperFind.superFindData.imgPath
         let selectSkins:string[] = Skin.getSelectSkinPath()
         selectSkins = selectSkins.length > 0?selectSkins:[defaultSkin]
@@ -119,6 +124,24 @@ export class SuperFindPanel extends Component {
         this.lvlContainer.showOrHideScale(this._showScale)
         this.showOrHideScaleLabel.string = this._showScale?"隐藏缩放":"显示缩放"
     }
+
+    countDown() {
+        this._gameTime--
+        if (this._gameTime <= 0) {
+            this.unschedule(this.countDown)
+            this.countDownLabel.string = "0秒"
+            return
+        }
+        this.countDownLabel.string = this._gameTime.toString() + "秒"
+    }
+
+    restartCountDown()
+    {
+        this._gameTime = 600
+        this.countDownLabel.string = this._gameTime.toString()+"秒"
+        this.unschedule(this.countDown)
+        this.schedule(this.countDown,1)
+    }
 }
 
 

+ 47 - 0
assets/script/Manager/LocalDataMgr.ts

@@ -720,6 +720,53 @@ export function getAllMapKeys(): number[] {
     return Object.keys(allMapList).map(Number);
 }
 
+export interface DanceData {
+    spinePath: string[];
+    scale: string[];
+    danceObjsPos:vector2Pos[];
+}
+
+export interface vector2Pos {
+    x: number;
+    y: number;
+}
+
+export class UserDanceData {
+    private _danceData: DanceData;
+
+    constructor() {
+        let obj = Skin.getSkinData().selectedSkinList[0]
+        let defaultData: DanceData = {
+            spinePath: [],
+            scale: [],
+            danceObjsPos: []
+        }
+        this._danceData = sys.localStorage.getItem("danceData") ? Object.assign(defaultData, JSON.parse(sys.localStorage.getItem("danceData"))) : defaultData
+    }
+    get danceData(): DanceData {
+        return this._danceData;
+    }
 
+    set danceData(data: Partial<DanceData>) {
+        Object.assign(this._danceData, data);
+        this.saveDanceData();
+    }
+    // 保存数据到本地存储
+    public saveDanceData(): void {
+        sys.localStorage.setItem("danceData", JSON.stringify(this._danceData));
+    }
+
+    clearData()
+    {
+        let defaultData: DanceData = {
+            spinePath: [],
+            scale: [],
+            danceObjsPos: []
+        }
+        this._danceData = defaultData
+        this.saveDanceData()
+    }
+}
 
+export const Dance = new UserDanceData();