Refactor (#1)

This commit is contained in:
elm
2025-08-10 23:07:13 +09:00
committed by GitHub
parent a4030eeaf3
commit dd6854b176
16 changed files with 133 additions and 963 deletions

View File

@@ -4,11 +4,8 @@
use bevy::prelude::*;
use bevy::time::common_conditions::on_timer;
use bevy::window::PrimaryWindow;
use bevy_cef::prelude::*;
use bevy_remote::{BrpResult, RemotePlugin};
use cef::Window;
use serde::Deserialize;
use std::time::Duration;
fn main() {

View File

@@ -32,7 +32,7 @@ fn spawn_webview(
asset_server: Res<AssetServer>,
) {
commands.spawn((
CefWebviewUri("https://bevy.org/".to_string()),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
MeshMaterial3d(materials.add(WebviewExtendedMaterial {
extension: CustomExtension {

View File

@@ -56,7 +56,7 @@ fn spawn_github_webview(
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
) {
commands.spawn((
CefWebviewUri("https://github.com/not-elm".to_string()),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
WebviewSize(Vec2::splat(800.0)),
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
@@ -70,7 +70,7 @@ fn spawn_google_search_webview(
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
) {
commands.spawn((
CefWebviewUri("https://www.youtube.com/".to_string()),
CefWebviewUri::new("https://not-elm.github.io/bevy_cef/"),
WebviewSize(Vec2::splat(800.0)),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),

View File

@@ -49,7 +49,7 @@ fn spawn_webview(
) {
commands.spawn((
DebugWebview,
CefWebviewUri("https://bevy.org/".to_string()),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial {
base: StandardMaterial {

View File

@@ -50,7 +50,7 @@ fn spawn_webview(
) {
commands.spawn((
DebugWebview,
CefWebviewUri("https://bevy.org/".to_string()),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
));

View File

@@ -33,7 +33,7 @@ fn spawn_webview(
mut materials: ResMut<Assets<WebviewExtendStandardMaterial>>,
) {
commands.spawn((
CefWebviewUri("https://bevy.org/".to_string()),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Mesh3d(meshes.add(Plane3d::new(Vec3::Z, Vec2::ONE))),
MeshMaterial3d(materials.add(WebviewExtendStandardMaterial::default())),
));

View File

@@ -16,7 +16,7 @@ fn spawn_camera_2d(mut commands: Commands) {
fn spawn_sprite_webview(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
commands.spawn((
CefWebviewUri::new("https://bevyengine.org/"),
CefWebviewUri::new("https://github.com/not-elm/bevy_cef"),
Pickable::default(),
Sprite {
image: images.add(Image::default()),