Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yyh
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
yyh
Commits
f30e05f0
Commit
f30e05f0
authored
Dec 09, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
55baa0d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
157 additions
and
0 deletions
+157
-0
Main.ts
egret/src/Main.ts
+5
-0
sceneTypes.ts
egret/src/types/sceneTypes.ts
+1
-0
TransInviterScene.ts
egret/src/yazuwei/TransInviterScene.ts
+151
-0
No files found.
egret/src/Main.ts
View file @
f30e05f0
...
@@ -185,6 +185,11 @@ class Main extends MainBase {
...
@@ -185,6 +185,11 @@ class Main extends MainBase {
Waiting
.
instance
.
hide
();
Waiting
.
instance
.
hide
();
return
;
return
;
}
}
if
(
window
[
'pageID'
]
==
'TransScene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
TransScene
);
Waiting
.
instance
.
hide
();
return
;
}
loadSvgaRes
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
);
loadSvgaRes
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
);
loadSvgaRes
(
getResPath
()
+
'resource/assets/svgas/trans.svga'
);
loadSvgaRes
(
getResPath
()
+
'resource/assets/svgas/trans.svga'
);
...
...
egret/src/types/sceneTypes.ts
View file @
f30e05f0
...
@@ -46,6 +46,7 @@ export enum ModuleTypes {
...
@@ -46,6 +46,7 @@ export enum ModuleTypes {
Share2Scene
,
Share2Scene
,
TeamShareScene
,
TeamShareScene
,
ShareStarterScene
,
ShareStarterScene
,
TransInviterScene
,
TransScene
,
TransScene
,
TransRecordPanel
,
TransRecordPanel
,
TOAST
TOAST
...
...
egret/src/yazuwei/TransInviterScene.ts
0 → 100644
View file @
f30e05f0
import
Scene
from
"../views/Scene"
;
import
{
getResPath
}
from
"../utils"
;
import
{
loadSvgaRes
,
loadSvga
}
from
"../loadSvga"
;
import
{
wait
}
from
"../GameConst"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
TransInviterScene
extends
Scene
{
_bg
:
SVGA
.
EgretMovieClip
;
_standby
:
SVGA
.
EgretMovieClip
;
_trans
:
SVGA
.
EgretMovieClip
;
_isInviterSide
=
false
;
_shareCode
;
protected
get
skinKey
()
{
return
'Trans'
}
constructor
(
data
)
{
super
();
this
.
initUI
(
data
);
}
async
initUI
(
data
)
{
// await Promise.all([
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress.svga'),
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress2.svga'),
// ]);
//要区分是分享者,还是被分享者
this
.
_bg
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/bg.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
this
.
_bg
.
visible
=
false
;
this
.
_standby
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
this
.
_standby
.
visible
=
false
;
this
.
_trans
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/trans.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
this
.
_trans
.
visible
=
false
;
this
.
changeToStandBy
();
this
[
'group'
].
addChild
(
this
[
'waitTips'
]);
this
[
'group'
].
addChild
(
this
[
'matchingTips'
]);
this
[
'group'
].
addChild
(
this
[
'shareTips'
]);
this
.
addAni
(
this
[
'waitTips'
]);
this
.
addAni
(
this
[
'matchingTips'
]);
this
.
addAni
(
this
[
'shareTips'
]);
// this['matchingTips'];
// this['shareTips'];
const
sharecode
=
0
;
if
(
this
.
_isInviterSide
)
{
//邀请者
this
[
'matchingTips'
].
visible
=
true
;
NetManager
.
ins
.
yyh_pollingAnimationState
((
success
)
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
if
(
data
==
3
)
{
//摇一摇
this
.
changeToTrans
();
this
[
'waitTips'
].
visible
=
false
;
this
[
'matchingTips'
].
visible
=
false
;
this
[
'shareTips'
].
visible
=
false
;
}
},
sharecode
,
()
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
if
(
data
==
1
)
{
//被邀请者确认邀请
this
[
'waitTips'
].
visible
=
true
;
this
[
'matchingTips'
].
visible
=
false
;
}
if
(
data
==
2
)
{
//用户取消
//暂时无法取消
}
return
data
===
null
||
data
===
0
||
data
==
1
||
data
==
2
;
})
}
else
{
this
.
setRightPhone
();
//邀请者
this
[
'shareTips'
].
visible
=
true
;
//进入页面后发送确认消息
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
1
,
(
success
)
=>
{
if
(
success
)
{
this
.
addShareEvent
();
}
});
}
}
addAni
(
d
)
{
egret
.
Tween
.
get
(
d
,
{
loop
:
true
})
.
to
({
alpha
:
0
},
500
).
wait
(
500
)
.
to
({
alpha
:
1
},
500
).
wait
(
500
);
}
addShareEvent
()
{
if
(
window
.
DeviceMotionEvent
)
{
var
speed
=
25
;
var
x
=
0
,
y
=
0
,
z
=
0
,
lastX
=
0
,
lastY
=
0
,
lastZ
=
0
;
window
.
addEventListener
(
'devicemotion'
,
(
event
)
=>
{
var
acceleration
=
event
.
accelerationIncludingGravity
;
x
=
acceleration
.
x
;
y
=
acceleration
.
y
;
if
(
Math
.
abs
(
x
-
lastX
)
>
speed
||
Math
.
abs
(
y
-
lastY
)
>
speed
)
{
this
[
'shareTips'
].
visible
=
false
;
NetManager
.
ins
.
yyh_updateAnimationState
(
this
.
_shareCode
,
3
,
(
success
)
=>
{
if
(
success
)
{
}
});
}
lastX
=
x
;
lastY
=
y
;
},
false
);
}
}
setRightPhone
()
{
this
.
_standby
.
x
=
-
750
;
this
.
_trans
.
x
=
-
750
;
}
changeToStandBy
()
{
this
.
_standby
.
visible
=
true
;
this
.
_trans
.
visible
=
false
;
this
.
_standby
.
gotoAndPlay
(
1
,
true
);
}
async
changeToTrans
()
{
this
.
_trans
.
gotoAndPlay
(
40
,
true
);
wait
(
500
).
then
(
async
()
=>
{
this
.
_bg
.
gotoAndPlay
(
1
,
true
);
await
wait
(
100
);
this
.
_bg
.
visible
=
true
;
this
.
_bg
.
once
(
egret
.
Event
.
COMPLETE
,
()
=>
{
this
.
_bg
.
stop
();
},
this
);
});
await
wait
(
100
);
this
.
_standby
.
visible
=
false
;
this
.
_trans
.
visible
=
true
;
this
.
_trans
.
once
(
egret
.
Event
.
COMPLETE
,
()
=>
{
console
.
log
(
'COMPLETE'
)
this
.
changeToStandBy
();
if
(
!
this
.
_isInviterSide
)
{
this
.
_standby
.
x
=
40
;
this
.
_standby
.
y
=
10
;
}
},
this
);
}
onTap_btn
()
{
console
.
log
(
'onTap_btn'
);
}
initEvents
()
{
// this.onTap(this['btn'], this.onTap_btn);
}
}
\ 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