Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg28_drag
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
dg28_drag
Commits
dad70bdf
Commit
dad70bdf
authored
Dec 15, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
左中
parent
4beae6b1
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
503 additions
and
78 deletions
+503
-78
dg28_drag.fire
assets/dg28_drag/scene/dg28_drag.fire
+73
-49
dg28_drag.ts
assets/dg28_drag/scene/dg28_drag.ts
+313
-28
dg28_drag_xiaodi.ts
assets/dg28_drag/scene/dg28_drag_xiaodi.ts
+108
-0
dg28_drag_xiaodi.ts.meta
assets/dg28_drag/scene/dg28_drag_xiaodi.ts.meta
+9
-0
tsconfig.json
tsconfig.json
+0
-1
No files found.
assets/dg28_drag/scene/dg28_drag.fire
View file @
dad70bdf
This diff is collapsed.
Click to expand it.
assets/dg28_drag/scene/dg28_drag.ts
View file @
dad70bdf
This diff is collapsed.
Click to expand it.
assets/dg28_drag/scene/dg28_drag_xiaodi.ts
0 → 100644
View file @
dad70bdf
import
pg
from
"
./pg
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
dg_xiaodi
extends
cc
.
Component
{
@
property
(
cc
.
Node
)
aniRole
:
cc
.
Node
=
null
;
@
property
moveX
:
number
=
500
;
private
defaultX
:
number
;
onLoad
()
{
this
.
defaultX
=
this
.
aniRole
.
x
;
}
private
audioIdEnter
:
any
;
playEnter
(
audioUrl
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
node
.
active
=
true
;
let
startX
=
this
.
defaultX
+
this
.
moveX
;
this
.
aniRole
.
x
=
startX
;
cc
.
tween
(
this
.
aniRole
)
.
call
(()
=>
{
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
run
'
);
if
(
this
.
moveX
<
0
)
{
this
.
aniRole
.
scaleX
=
-
this
.
aniRole
.
scaleX
;
}
})
.
to
(
0.5
,
{
x
:
0
})
.
call
(()
=>
{
if
(
this
.
moveX
<
0
)
{
this
.
aniRole
.
scaleX
=
-
this
.
aniRole
.
scaleX
;
}
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
talk
'
);
pg
.
audio
.
playAudioByUrl
(
audioUrl
,
()
=>
{
this
.
audioIdEnter
=
null
;
cc
.
tween
(
this
.
aniRole
)
.
call
(()
=>
{
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
run
'
);
if
(
this
.
moveX
<
0
)
{
this
.
aniRole
.
scaleX
=
-
this
.
aniRole
.
scaleX
;
}
})
.
to
(
0.5
,
{
x
:
-
1800
})
.
call
(()
=>
{
this
.
scheduleOnce
(()
=>
{
resolve
(
''
);
},
0.5
)
})
.
start
();
},
audioId
=>
{
this
.
audioIdEnter
=
audioId
;
})
})
.
start
();
});
}
playEnterEnd
()
{
this
.
node
.
active
=
false
;
if
(
this
.
audioIdEnter
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
audioIdEnter
)
}
}
private
audioIdOver
:
any
;
playOver
(
audioUrl
)
{
this
.
node
.
active
=
true
;
let
startX
=
this
.
defaultX
+
this
.
moveX
;
this
.
aniRole
.
x
=
startX
;
cc
.
tween
(
this
.
aniRole
)
.
call
(()
=>
{
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
run
'
);
if
(
this
.
moveX
<
0
)
{
this
.
aniRole
.
scaleX
=
-
this
.
aniRole
.
scaleX
;
}
})
.
to
(
0.3
,
{
x
:
this
.
defaultX
})
.
call
(()
=>
{
if
(
this
.
moveX
<
0
)
{
this
.
aniRole
.
scaleX
=
-
this
.
aniRole
.
scaleX
;
}
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
talk
'
);
pg
.
audio
.
playAudioByUrl
(
audioUrl
,
()
=>
{
this
.
audioIdOver
=
null
;
pg
.
view
.
playDBAnimation
(
this
.
aniRole
,
'
normal
'
);
},
audioId
=>
{
this
.
audioIdOver
=
audioId
;
})
})
.
start
();
}
playOverEnd
()
{
this
.
node
.
active
=
false
;
if
(
this
.
audioIdOver
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
audioIdOver
)
}
}
start
()
{
}
update
(
dt
)
{
}
}
assets/dg28_drag/scene/dg28_drag_xiaodi.ts.meta
0 → 100644
View file @
dad70bdf
{
"ver": "1.0.8",
"uuid": "4c50260e-13ba-4b6a-8001-fa53f011a8bc",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
tsconfig.json
View file @
dad70bdf
...
...
@@ -6,7 +6,6 @@
"experimentalDecorators"
:
true
,
"skipLibCheck"
:
true
,
"outDir"
:
"temp/vscode-dist"
,
"allowJs"
:
true
,
"forceConsistentCasingInFileNames"
:
true
},
"exclude"
:
[
...
...
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