5个版本
0.2.0 | 2024年7月10日 |
---|---|
0.1.3 | 2024年5月11日 |
0.1.2 | 2024年4月17日 |
0.1.1 | 2024年4月17日 |
0.1.0 | 2024年4月17日 |
在游戏开发类别中排名第1032
每月下载量:179次
10KB
192行代码(不包括注释)
bevy_ios_alerts
Rust存储库和Swift包,可轻松将iOS的原生UIAlerts API集成到Bevy应用程序中。
该存储库在我们的游戏中使用示例: zoolitaire.com
另请参阅 bevy_ios_iap,bevy_ios_notifications,bevy_ios_gamecenter,bevy_ios_review 以及 bevy_ios_impact
说明
- 添加到XCode:添加SPM(Swift包管理器)依赖
- 添加Rust依赖
- 设置插件
1. 添加到XCode
转到 文件
-> 添加包依赖
并将 https://github.com/rustunit/bevy_ios_alerts.git
粘贴到右上角的搜索栏中:
2. 添加Rust依赖
cargo add bevy_ios_alerts
或
bevy_ios_alerts = { version = "0.2" }
3. 设置插件
初始化Bevy插件
app.add_plugins(bevy_ios_alerts::IosAlertsPlugin);
在您的应用程序代码中触发警报
fn system_triggerin_alerts(mut events: EventWriter<IosAlert>) {
events.send(IosAlert::Message {
title: String::from("title"),
msg: String::from("msg"),
button: String::from("ok"),
});
events.send(IosAlert::Dialog {
title: String::from("title"),
msg: String::from("this is a dialog with multiple buttons"),
button_yes: String::from("absolutely yes"),
button_no: String::from("no no no"),
});
events.send(IosAlert::Input {
title: String::from("title"),
msg: String::from("input box"),
button: String::from("ok"),
placeholder: String::from("placeholder"),
});
}
fn process_alert_response(mut events: EventReader<IosAlertResponse>) {
for e in events.read() {
info!("incoming alert response: {e:?}");
}
}
Bevy版本支持
bevy | bevy_ios_alerts |
---|---|
0.14 | 0.2,main |
0.13 | 0.1 |
许可
本仓库中的所有代码均受以下任一许可的双重许可
- MIT许可(LICENSE-MIT 或 http://opensource.org/licenses/MIT)
- Apache许可证,版本2.0(LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
您可以选择其中一种。这意味着您可以选择您偏好的许可。
您的贡献
除非您明确表示,否则任何有意提交以包含在本作品中的贡献,根据Apache-2.0许可证的定义,应如上所述双重许可,而不附加任何其他条款或条件。
依赖关系
~23MB
~411K SLoC