Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置模型控件模型缩放 没效果 #601

Open
liang-1-qi opened this issue Jan 27, 2025 · 7 comments
Open

设置模型控件模型缩放 没效果 #601

liang-1-qi opened this issue Jan 27, 2025 · 7 comments

Comments

@liang-1-qi
Copy link

--设置模型控件模型缩放
---@param role py.Role # 玩家
---@param comp_name string # 控件名
---@param scale number # 模型缩放
function GameAPI.set_ui_model_model_scale(role, comp_name, scale) end

@zhangjun5469
Copy link
Collaborator

y3.game:event('键盘-按下', 'SPACE', function ()
    print('你按下了空格键!')
    GameAPI.set_ui_model_model_scale(y3.player(1).handle, "71a86bdd-a491-43c3-91a2-b51091b7c3f0", 0.1)
end)

===
测试了下,没问题啊,comp_name是控件id。

@liang-1-qi
Copy link
Author

我就是测试很多次没效果才来反馈的

@liang-1-qi
Copy link
Author

y3.game:event('键盘-按下', 'SPACE', function ()
    print('你按下了空格键!')
    GameAPI.set_ui_model_model_scale(y3.player(1).handle, "71a86bdd-a491-43c3-91a2-b51091b7c3f0", 0.1)
end)

=== 测试了下,没问题啊,comp_name是控件id。

选英雄的时候,每个模型大小是一样的,就需要切换 模型控件显示的缩放,改了一点效果没有

@liang-1-qi
Copy link
Author

Image我还加了延迟几帧再设置缩放

@zhangjun5469
Copy link
Collaborator

看上去,你的使用方式没问题呀。
我看你上面还采用了ECA的调用方式,也不行嘛?

@liang-1-qi
Copy link
Author

看上去,你的使用方式没问题呀。 我看你上面还采用了ECA的调用方式,也不行嘛?

完全没效果

@liang-1-qi
Copy link
Author

我录制个视频 发给百问

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants