Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
97f54765
Commit
97f54765
authored
Dec 06, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/ui/hover' into 'main'
Feat/ui/hover See merge request
mycard/Neos!35
parents
f788671c
ab36dbe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
src/config/ui.ts
src/config/ui.ts
+6
-0
src/ui/Duel/simpleDuel/hands.ts
src/ui/Duel/simpleDuel/hands.ts
+35
-0
No files found.
src/config/ui.ts
View file @
97f54765
...
...
@@ -55,6 +55,12 @@ export const HandRotation = () => {
export
const
HandColor
=
()
=>
{
return
BABYLON
.
Color3
.
White
();
};
export
const
HandHoverScaling
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.2
,
1.2
,
1
);
};
export
const
HandHoverOutScaling
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1
,
1
,
1
);
};
// 怪兽区
export
const
MonsterColor
=
()
=>
{
...
...
src/ui/Duel/simpleDuel/hands.ts
View file @
97f54765
...
...
@@ -29,6 +29,7 @@ export default (hands: Card[], scene: BABYLON.Scene) => {
scene
);
hand
.
material
=
handMaterial
;
// 事件管理
hand
.
actionManager
=
new
BABYLON
.
ActionManager
(
scene
);
// 监听点击事件
...
...
@@ -40,5 +41,39 @@ export default (hands: Card[], scene: BABYLON.Scene) => {
}
)
);
// 监听`Hover`事件
hand
.
actionManager
.
registerAction
(
new
BABYLON
.
CombineAction
(
{
trigger
:
BABYLON
.
ActionManager
.
OnPointerOverTrigger
},
[
new
BABYLON
.
SetValueAction
(
{
trigger
:
BABYLON
.
ActionManager
.
OnPointerOverTrigger
,
},
hand
,
"
scaling
"
,
CONFIG
.
HandHoverScaling
()
),
// TODO: 这里后续应该加上显示可操作按钮的处理
new
BABYLON
.
ExecuteCodeAction
(
BABYLON
.
ActionManager
.
OnPointerOverTrigger
,
(
event
)
=>
{
console
.
log
(
`<Hover>hand:
${
idx
}
`
,
"
event:
"
,
event
);
}
),
]
)
);
// 监听`Hover`离开事件
hand
.
actionManager
.
registerAction
(
new
BABYLON
.
SetValueAction
(
{
trigger
:
BABYLON
.
ActionManager
.
OnPointerOutTrigger
,
},
hand
,
"
scaling
"
,
CONFIG
.
HandHoverOutScaling
()
)
);
});
};
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