Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wildfirecode13
xiaoxiaole
Commits
56d675c8
Commit
56d675c8
authored
Apr 23, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡游戏显示默认北京页Bug
parent
27d77726
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
27 deletions
+33
-27
sceneCtrl.ts
egret/libs/new_wx/ctrls/sceneCtrl.ts
+22
-10
MainScene.ts
egret/src/mainScene/MainScene.ts
+9
-16
MapScene.ts
egret/src/mapScene/MapScene.ts
+2
-1
No files found.
egret/libs/new_wx/ctrls/sceneCtrl.ts
View file @
56d675c8
...
...
@@ -96,9 +96,20 @@ export default class SceneCtrl {
// scene.start(data);
// }, this);
// scene.addEventListener(egret.Event.ADDED_TO_STAGE,this.sceneAddStateListener,this);
let
oldScene
:
Scene
;
if
(
this
.
currentScene
){
oldScene
=
this
.
currentScene
;
}
scene
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
()
=>
{
// console.log("addToStageListener",scene.skinName);
scene
.
start
(
data
);
if
(
oldScene
){
console
.
log
(
"移除scene------------"
,
oldScene
.
skinName
);
oldScene
.
parent
&&
oldScene
.
parent
.
removeChild
(
oldScene
);
oldScene
.
destroy
();
oldScene
=
null
;
}
},
this
);
scene
.
onLoad
().
then
(()
=>
{
// console.log("onLoad---after",scene.skinName);
...
...
@@ -126,18 +137,19 @@ export default class SceneCtrl {
}
private
addToStage
(
scene
:
Scene
)
{
let
oldScene
:
Scene
;
if
(
this
.
_currentScene
)
{
oldScene
=
this
.
_currentScene
;
}
//
let oldScene: Scene;
//
if (this._currentScene) {
//
oldScene = this._currentScene;
//
}
this
.
_currentScene
=
scene
;
this
.
_parent
.
addChild
(
scene
);
wait
(
1000
).
then
(()
=>
{
if
(
oldScene
)
{
oldScene
.
destroy
();
this
.
_parent
.
removeChild
(
oldScene
);
}
});
// console.log("场景切换",scene.skinName,oldScene.skinName);
// wait(1000).then(()=>{
// if(oldScene) {
// oldScene.destroy();
// this._parent.removeChild(oldScene);
// }
// });
}
_sceneClassMap
:
any
;
...
...
egret/src/mainScene/MainScene.ts
View file @
56d675c8
...
...
@@ -417,6 +417,9 @@ export default class MainScene extends Scene {
this
.
mapContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
mapContainer
);
this
.
wormholeContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
wormholeContainer
);
//修改流沙的问题
this
.
mapupContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
mapupContainer
);
...
...
@@ -479,6 +482,7 @@ export default class MainScene extends Scene {
this
.
effectContainer
.
removeChildren
();
this
.
guideContainer
.
removeChildren
();
this
.
festivalContainer
.
removeChildren
();
this
.
wormholeContainer
.
removeChildren
();
}
async
start
(
data
)
{
super
.
start
();
...
...
@@ -883,16 +887,6 @@ export default class MainScene extends Scene {
this
.
map
=
bg
;
this
.
map
.
addChild
(
conveyor
);
this
.
wormholeContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
wormholeContainer
);
//修改流沙的问题
this
.
mapupContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
mapupContainer
);
//容器
this
.
elementContainer
=
new
egret
.
DisplayObjectContainer
();
this
.
addChild
(
this
.
elementContainer
);
//加遮罩,大遮罩一直都加,小遮罩时时判断
if
(
this
.
elementConMask
){
this
.
elementConMask
.
graphics
.
clear
();
...
...
@@ -1614,7 +1608,7 @@ export default class MainScene extends Scene {
}
removeEvents
()
{
// console.log('mainscene-----移除事件监听
------removeEvents');
console
.
log
(
'mainscene-
------removeEvents'
);
this
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
settingBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
);
this
.
questionBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
...
...
@@ -1633,11 +1627,6 @@ export default class MainScene extends Scene {
this
.
propBtnCon
.
stepBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_stepBtn
,
this
)
//容器事件
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
mouseDownE
,
this
);
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_MOVE
,
this
.
mouseMoveE
,
this
);
this
.
reCoverAllLattice
();
//回收炮台相关动画
for
(
var
i
=
0
;
i
<
this
.
cannoEffect
.
length
;
i
++
){
...
...
@@ -1661,6 +1650,10 @@ export default class MainScene extends Scene {
}
this
.
cannoEffect
=
new
Array
();
}
destroy
()
{
console
.
log
(
"mainscene-------------destroy"
);
super
.
destroy
();
}
onEnterFrame
()
{
if
(
this
.
enableTouch
&&
!
this
.
gameGuide
)
{
...
...
egret/src/mapScene/MapScene.ts
View file @
56d675c8
...
...
@@ -741,7 +741,7 @@ export default class MapScene extends Scene {
}
destroy
()
{
// console.log("map销毁
");
console
.
log
(
"map------------destroy
"
);
super
.
destroy
();
// this.removeIcon();
...
...
@@ -1238,6 +1238,7 @@ export default class MapScene extends Scene {
}
protected
removeEvents
(){
console
.
log
(
"map-----------removeEvents"
);
this
[
'goldBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_goldBtn
,
this
);
this
[
'guide'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_guide
,
this
);
// this['act2Btn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_act2btn, this);
...
...
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