feat: add builder configuration file
feat: add cocos-service configuration file feat: add device configuration file feat: add engine configuration file feat: add information configuration file feat: add program configuration file feat: add project configuration file feat: add TypeScript configuration file
This commit is contained in:
24
assets/script/model/GameModel.ts
Normal file
24
assets/script/model/GameModel.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Sprite, SpriteFrame, resources } from "cc";
|
||||
import { MainGame } from "../game/MainGame";
|
||||
|
||||
/** 游戏数据相关 */
|
||||
export class GameModel {
|
||||
/** 单例模式 */
|
||||
private static _instance: GameModel = new GameModel();
|
||||
private constructor() { }
|
||||
public static get _ins() {
|
||||
return this._instance;
|
||||
}
|
||||
/** 主场景 名字 */
|
||||
mainScene: string = "MainGame";
|
||||
|
||||
/** MainGame脚本 */
|
||||
mainGame: MainGame = null;
|
||||
/** 游戏分数 */
|
||||
gameScore: number = 1;
|
||||
/** 平均分 用来计算超越了多少玩家 */
|
||||
standScore: number = 80;
|
||||
/** 最高分 用来计算超越了多少玩家 */
|
||||
gameMaxScore: number = 200;
|
||||
|
||||
}
|
||||
9
assets/script/model/GameModel.ts.meta
Normal file
9
assets/script/model/GameModel.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "f69a5547-feea-4fbd-ad4d-f04735df5a8b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
50
assets/script/model/ResModel.ts
Normal file
50
assets/script/model/ResModel.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { AudioClip, Material, Prefab, SpriteFrame, Texture2D } from "cc";
|
||||
import { LoadTools } from "../common/LoadTools";
|
||||
|
||||
/** 资源存放的数据类 */
|
||||
export class ResModel {
|
||||
/** 单例模式 */
|
||||
private static _instance: ResModel = new ResModel();
|
||||
private constructor() { }
|
||||
public static get _ins() {
|
||||
return this._instance;
|
||||
}
|
||||
|
||||
/** 存储resArr脚本拖动的图片字典 */
|
||||
public SpriteFrameDic: Map<string, SpriteFrame> = new Map();
|
||||
/** 存储resArr脚本拖动的预制体字典 */
|
||||
public PrefabDic: Map<string, Prefab> = new Map();
|
||||
/** 存储resArr脚本拖动的音效字典 */
|
||||
public AudioClipDic: Map<string, AudioClip> = new Map();
|
||||
/** 存储resArr脚本拖动的材质字典 */
|
||||
public MaterialDic: Map<string, Material> = new Map();
|
||||
/** 存储resArr脚本拖动的Texture字典 */
|
||||
public TextureDic: Map<string, Texture2D> = new Map();
|
||||
|
||||
/** resArr清理字典 */
|
||||
public clearResDic() {
|
||||
this.AudioClipDic.clear();
|
||||
this.SpriteFrameDic.clear();
|
||||
this.PrefabDic.clear();
|
||||
this.MaterialDic.clear();
|
||||
this.TextureDic.clear();
|
||||
}
|
||||
|
||||
|
||||
/** 获取拖动到res 里面的 Texture 资源 */
|
||||
getTexture(key: string, callFunc?: (age: Texture2D) => {}): Texture2D {
|
||||
if (this.TextureDic[key]) {
|
||||
return this.TextureDic[key];
|
||||
} else {
|
||||
LoadTools._ins.loadResAny(key + "/texture", Texture2D, callFunc);
|
||||
}
|
||||
}
|
||||
/** 获取拖动到res 里面的 材质资源 */
|
||||
getMaterial(key: string, callFunc?: (age: Material) => {}) {
|
||||
if (this.MaterialDic[key]) {
|
||||
return this.MaterialDic[key];
|
||||
} else {
|
||||
LoadTools._ins.loadResAny(key, Material, callFunc);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
assets/script/model/ResModel.ts.meta
Normal file
9
assets/script/model/ResModel.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "90f35c76-cc50-4872-bd99-7af2500bfdf2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
39
assets/script/model/WordsModel.ts
Normal file
39
assets/script/model/WordsModel.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Tools } from "../common/Tools";
|
||||
import { weiSan } from "../common/weiSanTools";
|
||||
|
||||
/** 游戏内 文字翻译相关数据 */
|
||||
export var WordsModel = {
|
||||
gameName:{
|
||||
CN: "", //中文
|
||||
CHT: "", //繁体
|
||||
EN: "", //英文
|
||||
KOR: "", //韩文
|
||||
JP: "", //日文
|
||||
TH: "" //泰语
|
||||
},
|
||||
overScoreInfo_0: { CN:"只得0分,全球独一个!",CHT:"只得0分,全球獨一個!",
|
||||
EN:"Only 0, the only one in the world!", KOR:"0점밖에 안 돼, 전 세계에서 하나야!"
|
||||
, JP:"0点しか取れません。世界で唯一です", TH:"มีเพียง <NU>0 จุดหนึ่งในโลก" },
|
||||
|
||||
overScoreInfo_1: { CN:"击败了全球",CHT:"擊敗了全球", EN:"Beat ", KOR:"격파", JP:"打ち負かす", TH:"ทำให้พ่ายแพ้" },
|
||||
overScoreInfo_2: { CN:"的玩家!",CHT:"的玩家!", EN:" of the players!", KOR:"유저!", JP:"のプレイヤー!", TH:"ผู้เล่นของ" },
|
||||
overTitle_1:{
|
||||
CN:"我真是太厉害了,我在",CHT:"我真是太厲害了,我在",EN:"I'm really great. I'm in ",
|
||||
},
|
||||
overTitle_2:{
|
||||
CN:"中,",CHT:"中,",EN:". "
|
||||
},
|
||||
|
||||
/** 通过语言 获得文字翻译 */
|
||||
getStrForLanguage( modelKey:string , languageType?:string){
|
||||
languageType = languageType || Tools.getLanguageType();
|
||||
if(this[modelKey] ){
|
||||
if( this[modelKey][languageType] ){
|
||||
return this[modelKey][languageType];
|
||||
}
|
||||
return this[modelKey]["EN"];
|
||||
}else{
|
||||
weiSan.log("没有翻译:" + modelKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
assets/script/model/WordsModel.ts.meta
Normal file
9
assets/script/model/WordsModel.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "77968eaa-9734-4273-85e4-209355aa1cf5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user