Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_DG
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
middleLayer_for_DG
Commits
60a1eb9c
Commit
60a1eb9c
authored
Oct 24, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 全部功能
parent
d48c8e88
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
68 deletions
+90
-68
middleLayer_for_DG.fire
assets/middleLayer_for_DG/scene/middleLayer_for_DG.fire
+24
-24
middleLayer.ts
assets/middleLayer_for_DG/script/middleLayer.ts
+30
-7
util.js
assets/middleLayer_for_DG/script/util.js
+0
-37
btn_return.png
assets/middleLayer_for_DG/textures/btn_return.png
+0
-0
btn_return.png.meta
assets/middleLayer_for_DG/textures/btn_return.png.meta
+36
-0
No files found.
assets/middleLayer_for_DG/scene/middleLayer_for_DG.fire
View file @
60a1eb9c
...
...
@@ -98,8 +98,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1
28
0,
"height":
72
0
"width": 1
92
0,
"height":
108
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -110,8 +110,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
64
0,
36
0,
96
0,
54
0,
0,
0,
0,
...
...
@@ -243,8 +243,8 @@
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1
28
0,
"height":
72
0
"width": 1
92
0,
"height":
108
0
},
"_fitWidth": false,
"_fitHeight": true,
...
...
@@ -337,8 +337,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1
28
0,
"height":
72
0
"width": 1
92
0,
"height":
108
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -349,8 +349,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
64
0,
36
0,
96
0,
54
0,
0,
0,
0,
...
...
@@ -382,7 +382,7 @@
"__id__": 8
},
"_children": [],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
{
"__id__": 10
...
...
@@ -405,8 +405,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1
7
1,
"height": 1
46
"width": 1
3
1,
"height": 1
31
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -417,15 +417,15 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
577.25
,
303.5
,
-
863.522
,
453.12800000000004
,
0,
0,
0,
0,
1,
0.5
,
0.5
,
1
,
1
,
1
]
},
...
...
@@ -521,9 +521,9 @@
"alignMode": 2,
"_target": null,
"_alignFlags": 9,
"_left":
20
,
"_left":
30.977999999999952
,
"_right": 0,
"_top": 2
0
,
"_top": 2
1.371999999999957
,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
...
...
@@ -553,7 +553,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
dae06413-7c06-4a99-8a27-fc098af38812
"
"__uuid__": "
57bdc862-1a68-4657-9b66-b5115d097b7e
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -612,8 +612,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
43
7.75,
30
3.5,
75
7.75,
48
3.5,
0,
0,
0,
...
...
@@ -807,8 +807,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
56
7.75,
30
3.5,
88
7.75,
48
3.5,
0,
0,
0,
...
...
assets/middleLayer_for_DG/script/middleLayer.ts
View file @
60a1eb9c
...
...
@@ -42,6 +42,8 @@ export default class NewClass extends middleLayerBase {
return
;
}
this
.
loadOnlineCourseWare
(
this
.
course_id
,
false
,
this
.
courseware_id
);
this
.
initListener
();
}
onHomeworkFinish
(
callBack
,
data
=
null
)
{
...
...
@@ -63,8 +65,23 @@ export default class NewClass extends middleLayerBase {
});
}
exitFlag
;
initListener
()
{
const
ExitBtn
=
cc
.
find
(
'
middleLayer/ExitBtn
'
);
ExitBtn
.
on
(
"
click
"
,
()
=>
{
if
(
this
.
exitFlag
)
{
return
;
}
this
.
exitFlag
=
true
;
cc
.
tween
(
ExitBtn
)
.
to
(
0.1
,
{
scaleX
:
0.9
,
scaleY
:
1.1
})
.
to
(
0.1
,
{
scaleX
:
1.1
,
scaleY
:
0.9
})
.
to
(
0.1
,
{
scaleX
:
1
,
scaleY
:
1
})
.
call
(()
=>
{
this
.
callNativeFunction
({
name
:
"
exit
"
,
value
:
""
});
})
.
start
();
});
}
reWriteAir
()
{
...
...
@@ -166,6 +183,8 @@ export default class NewClass extends middleLayerBase {
paramStr
);
}
else
{
if
(
param
.
name
==
"
loadSceneList
"
)
{
// Mock数据
console
.
error
(
"
非源生环境,需要从URL中获取必要的参数
"
);
const
token
=
this
.
getQueryString
(
"
token
"
);
const
course_id
=
this
.
getQueryString
(
"
course_id
"
);
...
...
@@ -173,5 +192,9 @@ export default class NewClass extends middleLayerBase {
const
resobj
=
{
bundleInfo
:
{
token
,
course_id
,
courseware_id
}};
return
JSON
.
stringify
(
resobj
);
}
if
(
param
.
name
==
"
exit
"
)
{
console
.
log
(
"
==调用退出方法成功==参数:
"
,
paramStr
);
}
}
}
}
assets/middleLayer_for_DG/script/util.js
View file @
60a1eb9c
...
...
@@ -340,40 +340,3 @@ export function showTrebleFirework(baseNode, rabbonList) {
showFireworks
(
left
);
showFireworks
(
right
);
}
export
function
onHomeworkFinish
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
if
(
middleLayerComponent
.
role
==
'
student
'
)
{
middleLayerComponent
.
onHomeworkFinish
(()
=>
{
});
}
}
else
{
console
.
log
(
'
onHomeworkFinish
'
);
}
}
export
function
callMiddleLayerFunction
(
apiName
,
data
,
callback
)
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
middleLayerComponent
.
callMiddleLayerFunction
(
apiName
,
data
,
callback
);
}
else
{
console
.
log
(
'
callMiddleLayerFunction:
'
+
apiName
);
}
}
export
function
login
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
middleLayerComponent
.
callMiddleLayerFunction
(
'
NS_login
'
,
{
userName
:
'
username123
'
,
password
:
'
1234567
'
},
(
result
)
=>
{
console
.
log
(
result
);
});
}
else
{
console
.
log
(
'
NS_login
'
);
}
}
\ No newline at end of file
assets/middleLayer_for_DG/textures/btn_return.png
0 → 100644
View file @
60a1eb9c
8.53 KB
assets/middleLayer_for_DG/textures/btn_return.png.meta
0 → 100644
View file @
60a1eb9c
{
"ver": "2.3.5",
"uuid": "b8f292f2-73ea-41e1-9d85-993bc4197375",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 131,
"height": 131,
"platformSettings": {},
"subMetas": {
"btn_return": {
"ver": "1.0.4",
"uuid": "57bdc862-1a68-4657-9b66-b5115d097b7e",
"rawTextureUuid": "b8f292f2-73ea-41e1-9d85-993bc4197375",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 131,
"height": 131,
"rawWidth": 131,
"rawHeight": 131,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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