Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NGT_02
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
NGT_02
Commits
396d96dd
Commit
396d96dd
authored
Feb 24, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: global问题
parent
181499e2
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
508 additions
and
496 deletions
+508
-496
picNode.js
assets/NGT_02/PU20/script/picNode.js
+3
-0
NGT_02.js
assets/NGT_02/scene/NGT_02.js
+261
-262
_preDefine.js
assets/NGT_02/script/common/_preDefine.js
+18
-8
utils.js
assets/NGT_02/script/common/utils.js
+191
-193
speaker.js
assets/NGT_02/script/game/speaker.js
+30
-28
data_mgr.js
assets/NGT_02/script/manager/data_mgr.js
+1
-1
event_mgr.js
assets/NGT_02/script/manager/event_mgr.js
+1
-1
local_storage.js
assets/NGT_02/script/manager/local_storage.js
+1
-1
res_mgr.js
assets/NGT_02/script/manager/res_mgr.js
+1
-1
snd_mgr.js
assets/NGT_02/script/manager/snd_mgr.js
+1
-1
No files found.
assets/NGT_02/PU20/script/picNode.js
View file @
396d96dd
const
tools
=
require
(
"
../script/tools
"
);
import
{
initGlobal_NGT_02
}
from
"
../../script/common/_preDefine
"
;
var
picNode
=
cc
.
Class
({
extends
:
cc
.
Component
,
...
...
@@ -12,6 +14,7 @@ var picNode = cc.Class({
},
ctor
:
function
()
{
initGlobal_NGT_02
();
picNode
.
inst
=
this
;
g
.
picNode
=
picNode
;
},
...
...
assets/NGT_02/scene/NGT_02.js
View file @
396d96dd
This diff is collapsed.
Click to expand it.
assets/NGT_02/script/common/_preDefine.js
View file @
396d96dd
import
{
initDataMgr_NGT_02
}
from
"
../manager/data_mgr
"
;
import
{
initEventMgr_NGT_02
}
from
"
../manager/event_mgr
"
;
import
{
initStorageMgr_NGT_02
}
from
"
../manager/local_storage
"
;
import
{
initResMgr_NGT_02
}
from
"
../manager/res_mgr
"
;
import
{
initSndMgr_NGT_02
}
from
"
../manager/snd_mgr
"
;
import
{
initUtils_NGT_02
}
from
"
./utils
"
;
import
{
initEnumMgr_NGT_02
}
from
"
../game/speaker
"
;
// 全局环境预声明
function
initGlobal_NGT_02
()
{
export
function
initGlobal_NGT_02
()
{
console
.
log
(
'
window.g init
'
);
window
.
g
=
{};
initDataMgr_NGT_02
();
initEventMgr_NGT_02
();
initStorageMgr_NGT_02
();
initResMgr_NGT_02
();
initSndMgr_NGT_02
();
initUtils_NGT_02
();
if
(
!
window
.
g
)
{
window
.
g
=
{};
initDataMgr_NGT_02
();
initEventMgr_NGT_02
();
initStorageMgr_NGT_02
();
initResMgr_NGT_02
();
initSndMgr_NGT_02
();
initUtils_NGT_02
();
initEnumMgr_NGT_02
();
}
}
\ No newline at end of file
assets/NGT_02/script/common/utils.js
View file @
396d96dd
This diff is collapsed.
Click to expand it.
assets/NGT_02/script/game/speaker.js
View file @
396d96dd
g
.
enum
=
{
E_Audio
:
{
Star
:
0
,
//大星星
BtnCommom
:
1
,
//按钮
Flowers
:
2
,
//撒花
Right
:
3
,
//正确
Error
:
4
,
//错误
Question
:
5
,
//题数
}
export
function
initEnumMgr_NGT_02
()
{
g
.
enum
=
{
E_Audio
:
{
Star
:
0
,
//大星星
BtnCommom
:
1
,
//按钮
Flowers
:
2
,
//撒花
Right
:
3
,
//正确
Error
:
4
,
//错误
Question
:
5
,
//题数
},
};
}
/**
* 音效
*/
var
speaker
=
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
eff_audio
:
{
default
:
[],
type
:
cc
.
AudioClip
,
displayName
:
"
音效列表
"
},
},
properties
:
{
eff_audio
:
{
default
:
[],
type
:
cc
.
AudioClip
,
displayName
:
"
音效列表
"
,
},
},
ctor
:
function
()
{
speaker
.
inst
=
this
;
g
.
speaker
=
speaker
;
},
ctor
:
function
()
{
speaker
.
inst
=
this
;
g
.
speaker
=
speaker
;
},
// //播放音效
// playEffect: function (num, cb) {
// g.snd_mgr.playEffect(this.eff_audio[num], cb);
// },
// //播放音效
// playEffect: function (num, cb) {
// g.snd_mgr.playEffect(this.eff_audio[num], cb);
// },
playEffect
:
function
(
num
,
cb
)
{
g
.
snd_mgr
.
playMusic
(
this
.
eff_audio
[
num
],
1
,
cb
);
},
playEffect
:
function
(
num
,
cb
)
{
g
.
snd_mgr
.
playMusic
(
this
.
eff_audio
[
num
],
1
,
cb
);
},
});
assets/NGT_02/script/manager/data_mgr.js
View file @
396d96dd
/**
* 数据管理器
*/
function
initDataMgr_NGT_02
()
{
export
function
initDataMgr_NGT_02
()
{
g
.
data_mgr
=
{
data
:
null
,
//表所有数据
...
...
assets/NGT_02/script/manager/event_mgr.js
View file @
396d96dd
function
initEventMgr_NGT_02
()
{
export
function
initEventMgr_NGT_02
()
{
// 事件汞
let
eventList
=
{};
// 响应列表(元素结构:eventName,[[target:cb]])
g
.
event_mgr
=
{
...
...
assets/NGT_02/script/manager/local_storage.js
View file @
396d96dd
function
initStorageMgr_NGT_02
()
{
export
function
initStorageMgr_NGT_02
()
{
// localStorage封装
g
.
local_storage
=
{
// 背景音乐音量
...
...
assets/NGT_02/script/manager/res_mgr.js
View file @
396d96dd
function
initResMgr_NGT_02
()
{
export
function
initResMgr_NGT_02
()
{
/**
* 资源管理器
*/
...
...
assets/NGT_02/script/manager/snd_mgr.js
View file @
396d96dd
function
initSndMgr_NGT_02
()
{
export
function
initSndMgr_NGT_02
()
{
// 声音管理器
g
.
snd_mgr
=
{
bgmId
:
-
1
,
// 背景音乐的音频ID
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment