[add] HistoryPanel 完成

This commit is contained in:
2022-05-15 14:34:42 +08:00
parent d302a52d8d
commit ded2c7c1ed
5 changed files with 2751 additions and 2482 deletions

View File

@@ -12,6 +12,7 @@ import NodePackageManager from "../_BootLoader/Npm/NodePackageManager";
import ConfigManager from "./ConfigManager";
import { GameRecord, MemberData, ScoreResult } from "./MemberData";
import RecordManager from "./RecordManager";
import { URLSchemeHandler } from "./URLSchemeHandler";
const { ccclass, property } = cc._decorator;
@@ -20,16 +21,16 @@ export class Badminton extends cc.Component {
//#region property
@property({ type: cc.Prefab })
private toggleItem: cc.Prefab = null;
public toggleItem: cc.Prefab = null;
@property({ type: cc.Prefab })
private teamItem: cc.Prefab = null;
public teamItem: cc.Prefab = null;
@property({ type: cc.EditBox })
private inputNameText: cc.EditBox = null;
public inputNameText: cc.EditBox = null;
@property({ type: cc.Label })
private storageText: cc.Label = null;
public storageText: cc.Label = null;
@property({ type: cc.Node })
public ToggleItemContent: cc.Node = null;
@@ -135,6 +136,7 @@ export class Badminton extends cc.Component {
CoroutineV2.Single(self.HistoryPanel.Hide()).Start();
}
// textToSpeech = FindObjectOfType<TextToSpeech>();
self.HistoryPanel.Initial(self);
self.AvatarPanel.Initial(self);
CoroutineV2.Single(self.Show()).Start();
};
@@ -150,14 +152,13 @@ export class Badminton extends cc.Component {
public *Show(): IterableIterator<any> {
CoroutineV2.Single(this.ScoreBoard.Hide()).Start();
this._initUI();
// LoadStatus();
// // 跨日後計分清除
// if (PlayerPrefs.GetString("date") != today)
// {
// Debug.LogWarning("跨日後計分清除");
// ClearAllGameResult();
// }
// URLSchemeHandler.Init();
this.LoadStatus();
// 跨日後計分清除
if (LocalStorageData.Instance.Date !== Badminton.Today) {
cc.warn("跨日後計分清除");
this.OnClickClearAllGameResult();
}
URLSchemeHandler.Init();
}
//#endregion
@@ -545,6 +546,14 @@ export class Badminton extends cc.Component {
this.SaveStatus();
}
public OnClickBtn_History(): void {
CoroutineV2.Single(this.HistoryPanel.Show()).Start();
}
public OnClickBtn_Sound(): void {
CoroutineV2.Single(this.VoicePanel.Show()).Start();
}
//#endregion
public Log(a: any, b: any): void {

View File

@@ -0,0 +1,50 @@
const { ccclass, property } = cc._decorator;
@ccclass
export class URLSchemeHandler extends cc.Component {
//#region Custom
public static Init(): boolean {
try {
// bool isFirst = false;
// if (_instance == null) {
// _instance = Component.FindObjectOfType<URLSchemeHandler>();
// if (_instance == null) {
// _instance = new GameObject("URLSchemeOriginManager").AddComponent<URLSchemeHandler>();
// }
// isFirst = true;
// #if UNITY_EDITOR
// _instance.firstOpen = false;
// #endif
// }
// #if UNITY_EDITOR
// else
// {
// isFirst = _instance.firstOpen;
// }
// #endif
// #if UNITY_EDITOR || UNITY_ANDROID
// //Debug.LogWarning("URLSchemeHandler can not use in editor mode.");
// UtilsNativeActivity.Init();
// UtilsNativeActivity.SetCallbackOnNewIntent(_instance.callbackOnNewIntent);
// return isFirst;
// #elif UNITY_IPHONE || UNITY_IOS
// UtilsNativeActivity.Init();
// UtilsNativeActivity.SetCallbackOnNewIntent(_instance.callbackOnNewIntent);
// _setCallbackURLScheme(UtilsNativeActivity.HANDLER_OBJECT_NAME, UtilsNativeActivity.HANDLER_METHOD_NAME);
// return true;
// #endif
} catch (error: any) {
cc.error("URLSchemeHandler error : " + error.toString());
}
return false;
}
//#endregion
}