Bevy 0.16 upgrade (#24)
This commit is contained in:
26
src/main.rs
26
src/main.rs
@@ -36,16 +36,15 @@ use bevy::{
|
||||
render::view::ColorGrading,
|
||||
};
|
||||
use bevy_common_assets::ron::RonAssetPlugin;
|
||||
use bevy_polyline::PolylinePlugin;
|
||||
use bevy_sprite3d::Sprite3dPlugin;
|
||||
use bevy_steamworks::{FriendFlags, SteamworksClient, SteamworksPlugin};
|
||||
use bevy_steamworks::{Client, FriendFlags, SteamworksPlugin};
|
||||
use bevy_trenchbroom::prelude::*;
|
||||
use bevy_ui_gradients::UiGradientsPlugin;
|
||||
use camera::MainCamera;
|
||||
use heads_database::HeadDatabaseAsset;
|
||||
use loading_assets::AudioAssets;
|
||||
use std::io::{Read, Write};
|
||||
use utils::{billboards, sprite_3d_animation, squish_animation};
|
||||
use utils::{billboards, sprite_3d_animation, squish_animation, trail};
|
||||
|
||||
#[derive(Resource, Reflect, Debug)]
|
||||
#[reflect(Resource)]
|
||||
@@ -106,7 +105,6 @@ fn main() {
|
||||
|
||||
app.add_plugins(bevy_debug_log::LogViewerPlugin::default());
|
||||
app.add_plugins(PhysicsPlugins::default());
|
||||
app.add_plugins(PolylinePlugin);
|
||||
app.add_plugins(Sprite3dPlugin);
|
||||
app.add_plugins(TrenchBroomPlugin(TrenchBroomConfig::new("hedz")));
|
||||
app.add_plugins(UiGradientsPlugin);
|
||||
@@ -114,8 +112,10 @@ fn main() {
|
||||
|
||||
#[cfg(feature = "dbg")]
|
||||
{
|
||||
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||
app.add_plugins(WorldInspectorPlugin::new());
|
||||
app.add_plugins(bevy_inspector_egui::bevy_egui::EguiPlugin {
|
||||
enable_multipass_for_primary_context: true,
|
||||
});
|
||||
app.add_plugins(bevy_inspector_egui::quick::WorldInspectorPlugin::new());
|
||||
app.add_plugins(PhysicsDebugPlugin::default());
|
||||
|
||||
// app.add_plugins(bevy::pbr::wireframe::WireframePlugin)
|
||||
@@ -153,22 +153,24 @@ fn main() {
|
||||
app.add_plugins(utils::observers::plugin);
|
||||
app.add_plugins(water::plugin);
|
||||
app.add_plugins(head_drop::plugin);
|
||||
app.add_plugins(trail::plugin);
|
||||
|
||||
app.init_state::<GameState>();
|
||||
|
||||
app.insert_resource(AmbientLight {
|
||||
color: Color::WHITE,
|
||||
brightness: 400.,
|
||||
..Default::default()
|
||||
});
|
||||
app.insert_resource(ClearColor(Color::BLACK));
|
||||
//TODO: let use control this
|
||||
app.insert_resource(GlobalVolume::new(0.1));
|
||||
//TODO: let user control this
|
||||
app.insert_resource(GlobalVolume::new(Volume::Linear(0.4)));
|
||||
|
||||
app.add_systems(
|
||||
Startup,
|
||||
(
|
||||
write_trenchbroom_config,
|
||||
steam_system.run_if(resource_exists::<SteamworksClient>),
|
||||
steam_system.run_if(resource_exists::<Client>),
|
||||
),
|
||||
);
|
||||
app.add_systems(OnEnter(GameState::Playing), music);
|
||||
@@ -177,7 +179,7 @@ fn main() {
|
||||
app.run();
|
||||
}
|
||||
|
||||
fn steam_system(steam_client: Res<SteamworksClient>) {
|
||||
fn steam_system(steam_client: Res<Client>) {
|
||||
for friend in steam_client.friends().get_friends(FriendFlags::IMMEDIATE) {
|
||||
info!(
|
||||
"Steam Friend: {:?} - {}({:?})",
|
||||
@@ -215,7 +217,7 @@ fn music(assets: Res<AudioAssets>, mut commands: Commands) {
|
||||
AudioPlayer::new(assets.music.clone()),
|
||||
PlaybackSettings {
|
||||
mode: PlaybackMode::Loop,
|
||||
volume: Volume::new(0.6),
|
||||
volume: Volume::Linear(0.6),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
@@ -225,7 +227,7 @@ fn music(assets: Res<AudioAssets>, mut commands: Commands) {
|
||||
AudioPlayer::new(assets.ambient.clone()),
|
||||
PlaybackSettings {
|
||||
mode: PlaybackMode::Loop,
|
||||
volume: Volume::new(0.8),
|
||||
volume: Volume::Linear(0.8),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user